After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700078 - build: Fix bashisms in autogen.sh
build: Fix bashisms in autogen.sh
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-10 13:26 UTC by Emanuele Aina
Modified: 2013-05-10 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Fix bashisms in autogen.sh (948 bytes, patch)
2013-05-10 13:26 UTC, Emanuele Aina
none Details | Review
build: Get rid of bashisms in autogen.sh and switch back to /bin/sh (1.10 KB, patch)
2013-05-10 15:52 UTC, Emanuele Aina
accepted-commit_now Details | Review

Description Emanuele Aina 2013-05-10 13:26:40 UTC
Building with JHBuild on a Debian system with /bin/sh -> /bin/dash fails as
autogen.sh uses a few Bash-specific constructs.

In particular, the pushd/popd commands are not supported by dash and can be replaced
with plain cd, using `cd -' to switch back to the old dir.

Also substitute the "&>/dev/null" redirection with ">/dev/null 2>&1".
Comment 1 Emanuele Aina 2013-05-10 13:26:42 UTC
Created attachment 243782 [details] [review]
build: Fix bashisms in autogen.sh

The pushd/popd commands are Bash-specific, replace them with plain cd,
using `cd -' to switch back to the old dir.

Also substitute the "&>/dev/null" redirection with ">/dev/null 2>&1".
Comment 2 Christian Persch 2013-05-10 14:51:22 UTC
Already fixed on master by just using #!/bin/bash.

*** This bug has been marked as a duplicate of bug 699990 ***
Comment 3 Emanuele Aina 2013-05-10 15:03:41 UTC
Ouch, my fault for not checking before submitting the bug and for not noticing the day-old checkout I had.

However, the changes are concise and clear as the original code, and should make those few who don't have Bash installed happier, maybe they can be applied and the /bin/bash change reverted? (Not that I care too much, being a Bash user myself.)
Comment 4 Christian Persch 2013-05-10 15:06:02 UTC
While I agree the changes aren't huge (and would have taken the patch if it hadn't already been fixed), I just feel that changing /bin/sh -> /bin/bash is the most I'm willing to accomodate debian's "/bin/sh is dash" craziness :-)
Comment 5 Emanuele Aina 2013-05-10 15:13:55 UTC
I was thinking more about those who only have Zsh installed: by changing the interpreter line to require Bash they're no longer able to launch ./autogen.sh even if Zsh handles the Bash extensions used just fine.

In that regard, putting back /bin/sh would be less bad as it would break only for those crazy Debian users with Dash as /bin/sh. ;)

Yes, the marvels of shell compatibility. %)
Comment 6 Emanuele Aina 2013-05-10 15:52:57 UTC
Created attachment 243800 [details] [review]
build: Get rid of bashisms in autogen.sh and switch back to /bin/sh

The pushd/popd commands are Bash-specific but in our simple case they
can be easily replaced with plain cd, using `cd -' to switch back to the
old dir.

Also substitute the "&>/dev/null" redirection with ">/dev/null 2>&1".
Comment 7 Christian Persch 2013-05-10 16:13:21 UTC
Comment on attachment 243800 [details] [review]
build: Get rid of bashisms in autogen.sh and switch back to /bin/sh

Alright then :-)
Comment 8 Christian Persch 2013-05-10 16:16:40 UTC
Pushed to master.