diff options
author | Ian Lynagh <igloo@earth.li> | 2011-11-19 01:29:05 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-11-19 01:52:32 +0000 |
commit | 80e9070c77718b7ff0e913182e54842754726ce8 (patch) | |
tree | 12804916372a3675a7d1beb00bd41e70083c5edf /rules/shell-wrapper.mk | |
parent | 042841713eb6468696eeb437de994c52eb7a858e (diff) | |
download | haskell-80e9070c77718b7ff0e913182e54842754726ce8.tar.gz |
Improve the way we call "rm" in the build system; fixes trac #4916
We avoid calling "rm -rf" with no file arguments; this fixes cleaning
on Solaris, where that fails.
We also check for suspicious arguments: anything containing "..",
starting "/", or containing a "*" (you need to call $(wildcard ...)
yourself now if you really want globbing). This should make things
a little safer.
Diffstat (limited to 'rules/shell-wrapper.mk')
-rw-r--r-- | rules/shell-wrapper.mk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk index 5cc10dc347..2376db137f 100644 --- a/rules/shell-wrapper.mk +++ b/rules/shell-wrapper.mk @@ -36,7 +36,7 @@ all_$1_$2 : $$(INPLACE_BIN)/$$($1_$2_PROG) $$(INPLACE_BIN)/$$($1_$2_PROG): WRAPPER=$$@ $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) $$($1_$2_SHELL_WRAPPER_NAME) - "$$(RM)" $$(RM_OPTS) $$@ + $$(call removeFiles, $$@) echo '#!$$(SHELL)' >> $$@ echo 'executablename="$$(TOP)/$$<"' >> $$@ echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"' >> $$@ @@ -65,7 +65,7 @@ install: install_$1_$2_wrapper install_$1_$2_wrapper: WRAPPER=$$(DESTDIR)$$(bindir)/$$($1_$2_INSTALL_SHELL_WRAPPER_NAME) install_$1_$2_wrapper: $$(call INSTALL_DIR,"$$(DESTDIR)$$(bindir)") - "$$(RM)" $$(RM_OPTS) "$$(WRAPPER)" + $$(call removeFiles, "$$(WRAPPER)") $$(CREATE_SCRIPT) "$$(WRAPPER)" echo '#!$$(SHELL)' >> "$$(WRAPPER)" echo 'exedir="$$(ghclibexecdir)"' >> "$$(WRAPPER)" |