* config/instsh.cf
* config/dirsh.cf
* config/globsh.cf
! Added double quotes to all 'if [ -? * ]' expressions:
'if [ -? "*" ]'. This fixes clean rule in Solaris builds
'[ -z $(EXE_FILE) ]' when $(EXE_FILE) was empty.
(Thanks for Tamas Tevesz for report and fix suggestion)
Please speak up if there is any reason why double quotes
weren't used in bash commands embedded in .cf files while
they are consistently used in all .sh files.
103 lines
1.9 KiB
CFEngine3
103 lines
1.9 KiB
CFEngine3
#
|
|
# $Id$
|
|
#
|
|
|
|
ifneq ($(HB_SHELL),sh)
|
|
|
|
INSTALL_DIR_OS = $(subst /,\,$(INSTALL_DIR))
|
|
INSTALL_FILES_OS = $(subst /,\,$(INSTALL_FILES))
|
|
|
|
endif
|
|
|
|
ifeq ($(INSTALL_FILES),) # Empty install list
|
|
|
|
INSTALL_RULE =\
|
|
@echo Done
|
|
|
|
else
|
|
|
|
ifeq ($(INSTALL_DIR),) # Empty install dir
|
|
|
|
INSTALL_RULE =\
|
|
@echo Done
|
|
|
|
else
|
|
|
|
ifeq ($(HB_SHELL),sh)
|
|
|
|
INSTALL_RULE =\
|
|
@$(MDP) $(subst \,/,$(INSTALL_DIR)); \
|
|
if [ ! -d "$(subst \,/,$(INSTALL_DIR))" ]; \
|
|
then \
|
|
echo "! Can't install, path not found: '$(subst \,/,$(INSTALL_DIR))'" 1>&2; \
|
|
false; \
|
|
else \
|
|
for i in $(INSTALL_FILES); \
|
|
do \
|
|
if [ -r "$$i" ]; \
|
|
then \
|
|
echo "! Installing $$i on $(subst \,/,$(INSTALL_DIR))"; \
|
|
$(CP) $$i $(subst \,/,$(INSTALL_DIR)); \
|
|
true; \
|
|
else \
|
|
echo "! Can't install $$i, not found" 1>&2; \
|
|
fi \
|
|
done \
|
|
fi
|
|
|
|
endif
|
|
|
|
ifeq ($(HB_SHELL),nt)
|
|
|
|
INSTALL_RULE =\
|
|
-$(CMDPREF)if not exist "$(INSTALL_DIR_OS)" $(MDP) "$(INSTALL_DIR_OS)" &\
|
|
for %%f in ($(INSTALL_FILES_OS)) do copy "%%f" "$(INSTALL_DIR_OS)"
|
|
|
|
endif
|
|
|
|
ifeq ($(HB_SHELL),os2)
|
|
|
|
define inst_file_all
|
|
if not exist $(INSTALL_DIR_OS) $(MD) $(INSTALL_DIR_OS)
|
|
$(foreach file, $(INSTALL_FILES_OS), $(inst_file))
|
|
|
|
endef
|
|
|
|
# We have to use script to overcome the max command size limit
|
|
# NOTE: The empty line directly before 'endef' HAVE TO exist!
|
|
# It causes that every commands will be separated by LF
|
|
define inst_file
|
|
$(CP) $(file) $(INSTALL_DIR_OS)
|
|
|
|
endef
|
|
|
|
INSTALL_RULE =\
|
|
$(inst_file_all)
|
|
|
|
endif
|
|
|
|
ifeq ($(HB_SHELL),dos)
|
|
|
|
define inst_file_all
|
|
$(MDP) $(INSTALL_DIR_OS)
|
|
$(foreach file, $(INSTALL_FILES_OS), $(inst_file))
|
|
|
|
endef
|
|
|
|
# We have to use script to overcome the DOS limit of max 128 characters
|
|
# NOTE: The empty line directly before 'endef' HAVE TO exist!
|
|
# It causes that every commands will be separated by LF
|
|
define inst_file
|
|
$(CP) $(file) $(INSTALL_DIR_OS)
|
|
|
|
endef
|
|
|
|
INSTALL_RULE =\
|
|
$(inst_file_all)
|
|
|
|
endif
|
|
|
|
endif # Empty install dir
|
|
|
|
endif # Empty install list
|