From: Zac Medico Date: Thu, 5 Aug 2010 06:18:52 +0000 (-0700) Subject: Bug #308835 - Make econf() use sed to substitute $CONFIG_SHELL in X-Git-Tag: v2.2_rc68~408 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b1e8c0e266cf875787cf44ee22458008845d22a4;p=portage.git Bug #308835 - Make econf() use sed to substitute $CONFIG_SHELL in the shebang of configure scripts when appropriate. --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 9c599c01b..a68b9731f 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -479,6 +479,11 @@ econf() { : ${ECONF_SOURCE:=.} if [ -x "${ECONF_SOURCE}/configure" ]; then + if [[ -n $CONFIG_SHELL && \ + "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh[[:space:]]*$ ]] ; then + sed -e "1s:.*:#!$CONFIG_SHELL" -i "$ECONF_SOURCE/configure" || \ + die "Substition of shebang in '$ECONF_SOURCE/configure' failed" + fi if [ -e /usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ -name config.guess -o -name config.sub ')' -print0 | \