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 780215 - Fix bashism in autogen.sh
Fix bashism in autogen.sh
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-17 17:52 UTC by Tommy Liertzer
Modified: 2017-05-24 14:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix bashism in autogen.sh (857 bytes, patch)
2017-03-17 17:52 UTC, Tommy Liertzer
none Details | Review
build: Use subshell instead of pushd to avoid requiring bash (985 bytes, patch)
2017-04-20 14:38 UTC, Ting-Wei Lan
none Details | Review
build: Use subshell instead of pushd to avoid requiring bash (1.01 KB, patch)
2017-04-21 07:25 UTC, Ting-Wei Lan
rejected Details | Review
Fix bashism in autogen.sh (916 bytes, patch)
2017-04-21 08:01 UTC, Tommy Liertzer
committed Details | Review
build: Use #!/bin/sh instead of #!/bin/bash (607 bytes, patch)
2017-05-24 14:10 UTC, Ting-Wei Lan
committed Details | Review

Description Tommy Liertzer 2017-03-17 17:52:02 UTC
pushd and popd are not available in dash and thus autogen.sh fails
when /bin/sh is symlinked to dash
Comment 1 Tommy Liertzer 2017-03-17 17:52:06 UTC
Created attachment 348198 [details] [review]
Fix bashism in autogen.sh
Comment 2 Florian Müllner 2017-03-17 18:10:01 UTC
Review of attachment 348198 [details] [review]:

Sure
Comment 3 Ting-Wei Lan 2017-04-20 14:38:05 UTC
Created attachment 350136 [details] [review]
build: Use subshell instead of pushd to avoid requiring bash

This patch uses a subshell, so it doesn't have to save the working directory
before switching to srcdir.
Comment 4 Jonas Ådahl 2017-04-21 03:18:45 UTC
Review of attachment 348198 [details] [review]:

::: autogen.sh
@@ +7,3 @@
 REQUIRED_AUTOMAKE_VERSION=1.11
 
+olddir=`pwd`

I suspect this needs to be

olddir="$(pwd)"

to not regress.

@@ +22,3 @@
 autoreconf --verbose --force --install || exit 1
 
+cd $olddir

And this needs to be

cd "$olddir"
Comment 5 Ting-Wei Lan 2017-04-21 07:25:49 UTC
Created attachment 350183 [details] [review]
build: Use subshell instead of pushd to avoid requiring bash
Comment 6 Tommy Liertzer 2017-04-21 08:01:33 UTC
Created attachment 350184 [details] [review]
Fix bashism in autogen.sh
Comment 7 Tommy Liertzer 2017-04-21 08:05:51 UTC
Sry, I didn't notice the other patch here and redid the original patch after I got the mail with the patch review from Jonas Ådahl. Feel free to apply either version.
Comment 8 Ting-Wei Lan 2017-05-10 15:04:48 UTC
Can we get patches reviewed again? It is still not fixed in git master and 3.24 releases. Both mutter and gnome-shell have the same bug.
Comment 9 Florian Müllner 2017-05-10 19:33:22 UTC
Review of attachment 350184 [details] [review]:

LGTM
Comment 10 Florian Müllner 2017-05-10 19:33:51 UTC
Review of attachment 350183 [details] [review]:

The other patch is closer to https://wiki.gnome.org/Projects/GnomeCommon/Migration, so let's go with that one
Comment 11 Florian Müllner 2017-05-11 12:29:21 UTC
Attachment 350184 [details] pushed as e146428 - Fix bashism in autogen.sh
Comment 12 Ting-Wei Lan 2017-05-11 13:19:53 UTC
Thanks for your review. Can we commit the accepted patch to gnome-shell, too?
Comment 13 Florian Müllner 2017-05-11 13:55:53 UTC
Done, but it missed 3.24.2.
Comment 14 Ting-Wei Lan 2017-05-23 01:33:20 UTC
nice: /home/lantw44/gnome/source/gnome-shell/autogen.sh: No such file or directory

Can we replace #!/bin/bash in gnome-shell autogen.sh with #!/bin/sh?
Comment 15 Jonas Ådahl 2017-05-23 01:38:01 UTC
(In reply to Ting-Wei Lan from comment #14)
> nice: /home/lantw44/gnome/source/gnome-shell/autogen.sh: No such file or
> directory
> 
> Can we replace #!/bin/bash in gnome-shell autogen.sh with #!/bin/sh?

I don't see why not.
Comment 16 Ting-Wei Lan 2017-05-24 14:10:57 UTC
Created attachment 352504 [details] [review]
build: Use #!/bin/sh instead of #!/bin/bash

There is no bashism in autogen.sh now.
Comment 17 Florian Müllner 2017-05-24 14:20:26 UTC
Review of attachment 352504 [details] [review]:

Sure
Comment 18 Ting-Wei Lan 2017-05-24 14:53:28 UTC
Comment on attachment 352504 [details] [review]
build: Use #!/bin/sh instead of #!/bin/bash

Attachment 352504 [details] pushed as 63f2fdd - build: Use #!/bin/sh instead of #!/bin/bash