summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-08-07 19:38:59 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2010-08-07 19:38:59 +0200
commit6dcb8b35d6bda91556ab5bb05d0666f71d207fc9 (patch)
tree9201b9b7d06dedeee53b0258315bb30ade59fd1c
parenteabb5944a6e4f540b3c1a74485e15cd42789ff94 (diff)
downloadportage-6dcb8b35d6bda91556ab5bb05d0666f71d207fc9.tar.gz
portage-6dcb8b35d6bda91556ab5bb05d0666f71d207fc9.tar.bz2
portage-6dcb8b35d6bda91556ab5bb05d0666f71d207fc9.zip
Bug #308835: Support options in shebang and terminate 's' option of sed.
-rwxr-xr-xbin/ebuild.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index a68b9731f..2affc923a 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -480,8 +480,8 @@ 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" || \
+ "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
+ sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
fi
if [ -e /usr/share/gnuconfig/ ]; then