GNOME Bugzilla – Bug 700078
build: Fix bashisms in autogen.sh
Last modified: 2013-05-10 16:16: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".
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".
Already fixed on master by just using #!/bin/bash. *** This bug has been marked as a duplicate of bug 699990 ***
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.)
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 :-)
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. %)
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 on attachment 243800 [details] [review] build: Get rid of bashisms in autogen.sh and switch back to /bin/sh Alright then :-)
Pushed to master.