summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-11-19 01:29:05 +0000
committerIan Lynagh <igloo@earth.li>2011-11-19 01:52:32 +0000
commit80e9070c77718b7ff0e913182e54842754726ce8 (patch)
tree12804916372a3675a7d1beb00bd41e70083c5edf /driver
parent042841713eb6468696eeb437de994c52eb7a858e (diff)
downloadhaskell-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 'driver')
-rw-r--r--driver/ghci/ghc.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/driver/ghci/ghc.mk b/driver/ghci/ghc.mk
index 31e84d6abb..51203ab4d5 100644
--- a/driver/ghci/ghc.mk
+++ b/driver/ghci/ghc.mk
@@ -18,12 +18,12 @@ install: install_driver_ghci
install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
install_driver_ghci:
$(call INSTALL_DIR,"$(DESTDIR)$(bindir)")
- "$(RM)" $(RM_OPTS) "$(WRAPPER)"
+ $(call removeFiles, "$(WRAPPER)")
$(CREATE_SCRIPT) "$(WRAPPER)"
echo '#!$(SHELL)' >> "$(WRAPPER)"
echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive $${1+"$$@"}' >> "$(WRAPPER)"
$(EXECUTABLE_FILE) "$(WRAPPER)"
- "$(RM)" $(RM_OPTS) "$(DESTDIR)$(bindir)/ghci"
+ $(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
$(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"
else # Windows...
@@ -53,7 +53,7 @@ install_driver_ghcii: GHCII_SCRIPT=$(DESTDIR)$(bindir)/ghcii.sh
install_driver_ghcii: GHCII_SCRIPT_VERSIONED = $(DESTDIR)$(bindir)/ghcii-$(ProjectVersion).sh
install_driver_ghcii:
$(call INSTALL_DIR,$(DESTDIR)$(bindir))
- "$(RM)" $(RM_OPTS) $(GHCII_SCRIPT)
+ $(call removeFiles,$(GHCII_SCRIPT))
echo "#!$(SHELL)" >> $(GHCII_SCRIPT)
echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT)
$(EXECUTABLE_FILE) $(GHCII_SCRIPT)