[DHG_packages] 03/03: ghc: patch to avoid using $SHELL

Joachim Breitner nomeata at moszumanska.debian.org
Mon May 23 14:04:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to annotated tag ghc_v7.10.3-8
in repository DHG_packages.

commit 3a38be2c4e53c9d8f42ae50c41baadf83e7e7fc9
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon May 23 14:20:44 2016 +0200

    ghc: patch to avoid using $SHELL
---
 p/ghc/debian/changelog                |  5 ++-
 p/ghc/debian/patches/do-not-use-SHELL | 65 +++++++++++++++++++++++++++++++++++
 p/ghc/debian/patches/series           |  1 +
 p/ghc/debian/rules                    |  4 ---
 4 files changed, 68 insertions(+), 7 deletions(-)

diff --git a/p/ghc/debian/changelog b/p/ghc/debian/changelog
index f53ec33..1984adb 100644
--- a/p/ghc/debian/changelog
+++ b/p/ghc/debian/changelog
@@ -6,9 +6,8 @@ ghc (7.10.3-8) unstable; urgency=medium
   * Convert `debian/copyright' to dep5 format
 
   [ Joachim Breitner ]
-  * In debian/rules, set SHELL to /bin/sh, as this variable is used to create
-    the shebang in the generated wrapper scripts, and we don't want /bin/bash
-    there just because whoever built the package is using that.
+  * Ensure that the shebang in the generated wrapper scripts use /bin/sh, and
+    not the value of SHELL of the current user.
 
  -- Joachim Breitner <nomeata at debian.org>  Mon, 23 May 2016 12:44:05 +0200
 
diff --git a/p/ghc/debian/patches/do-not-use-SHELL b/p/ghc/debian/patches/do-not-use-SHELL
new file mode 100644
index 0000000..d811bd0
--- /dev/null
+++ b/p/ghc/debian/patches/do-not-use-SHELL
@@ -0,0 +1,65 @@
+Description: Do not use $SHELL
+ as $SHELL is the user's preferred interactive shell. We do not want this to
+ leak into the wrapper scripts.
+Author: Joachim Breitner <nomeata at debian.org>
+
+--- ghc-7.10.3.orig/driver/ghci/ghc.mk
++++ ghc-7.10.3/driver/ghci/ghc.mk
+@@ -21,7 +21,7 @@ install_driver_ghci:
+ 	$(call INSTALL_DIR,"$(DESTDIR)$(bindir)")
+ 	$(call removeFiles,                                "$(WRAPPER)")
+ 	$(CREATE_SCRIPT)                                   "$(WRAPPER)"
+-	echo '#!$(SHELL)'                               >> "$(WRAPPER)"
++	echo '#!/bin/sh'                                >> "$(WRAPPER)"
+ 	echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
+ 	$(EXECUTABLE_FILE)                                 "$(WRAPPER)"
+ 	$(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
+@@ -56,7 +56,7 @@ install_driver_ghcii: GHCII_SCRIPT_VERSI
+ install_driver_ghcii:
+ 	$(call INSTALL_DIR,$(DESTDIR)$(bindir))
+ 	$(call removeFiles,"$(GHCII_SCRIPT)")
+-	echo "#!$(SHELL)"                                  >> $(GHCII_SCRIPT)
++	echo "#!/bin/sh"                                        >> $(GHCII_SCRIPT)
+ 	echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
+ 	$(EXECUTABLE_FILE) $(GHCII_SCRIPT)
+ 	cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
+--- ghc-7.10.3.orig/rules/shell-wrapper.mk
++++ ghc-7.10.3/rules/shell-wrapper.mk
+@@ -36,7 +36,7 @@ $$(INPLACE_WRAPPER): $$($1_$2_SHELL_WRAP
+ endif
+ $$(INPLACE_WRAPPER): $$($1_$2_INPLACE)
+ 	$$(call removeFiles,                                                    $$@)
+-	echo '#!$$(SHELL)'                                                   >> $$@
++	echo '#!/bin/sh'                                                     >> $$@
+ 	echo 'executablename="$$(TOP)/$$<"'                                  >> $$@
+ 	echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'                             >> $$@
+ 	echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'                              >> $$@
+@@ -74,7 +74,7 @@ install_$1_$2_wrapper:
+ 	$$(call INSTALL_DIR,"$$(DESTDIR)$$(bindir)")
+ 	$$(call removeFiles,                                        "$$(WRAPPER)")
+ 	$$(CREATE_SCRIPT)                                           "$$(WRAPPER)"
+-	echo '#!$$(SHELL)'                                       >> "$$(WRAPPER)"
++	echo '#!/bin/sh'                                         >> "$$(WRAPPER)"
+ 	echo 'exedir="$$(ghclibexecdir)/bin"'                    >> "$$(WRAPPER)"
+ 	echo 'exeprog="$$($1_$2_PROG)"'                          >> "$$(WRAPPER)"
+ 	echo 'executablename="$$$$exedir/$$$$exeprog"'           >> "$$(WRAPPER)"
+@@ -99,7 +99,7 @@ BINDIST_EXTRAS += $$($1_$2_BINDIST_WRAPP
+ 
+ $$($1_$2_BINDIST_WRAPPER): $1/$2/build/tmp/$$($1_$2_PROG)
+ 	$$(call removeFiles,                                                  $$@)
+-	echo '#!$$(SHELL)'                                                 >> $$@
++	echo '#!/bin/sh'                                                    >> $$@
+ ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
+ 	echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_REL_DIRS_SEARCHPATH))' >> $$@
+ endif
+--- ghc-7.10.3.orig/utils/mkdirhier/ghc.mk
++++ ghc-7.10.3/utils/mkdirhier/ghc.mk
+@@ -15,7 +15,7 @@ $(MKDIRHIER) : utils/mkdirhier/mkdirhier
+ 	-mkdir $(INPLACE_BIN)
+ 	-mkdir $(INPLACE_LIB)
+ 	$(call removeFiles,$@)
+-	echo '#!$(SHELL)'  		 >> $@
++	echo '#!/bin/sh'		 >> $@
+ 	cat utils/mkdirhier/mkdirhier.sh >> $@
+ 	$(EXECUTABLE_FILE) $@
+ 
diff --git a/p/ghc/debian/patches/series b/p/ghc/debian/patches/series
index c6d7a85..0c2f607 100644
--- a/p/ghc/debian/patches/series
+++ b/p/ghc/debian/patches/series
@@ -7,3 +7,4 @@ reproducible-tmp-names
 cabal-show-detail-direct.patch
 sh4-platform-detection-support.patch
 sparc64-initial-platform-support.patch
+do-not-use-SHELL
diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules
index 13fe877..779d315 100755
--- a/p/ghc/debian/rules
+++ b/p/ghc/debian/rules
@@ -18,10 +18,6 @@
 # ghc-cabal expects it to be available.
 export HOME = /homedoesnotexistatbuildtime
 
-# Set SHELL to /bin/sh. rules/shell-wrapper.mk uses this variable to set the
-# shebang in the generated wrapper scripts.
-export SHELL = /bin/sh
-
 # From /usr/share/doc/autotools-dev/examples/rules.gz:
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list