GNOME Bugzilla – Bug 726911
#!/bin/bash in test/run-in-tree.sh
Last modified: 2018-09-21 17:40:44 UTC
Some systems do not have bash installed in /bin, and test/run-in-tree.sh does not use bash-specific features. We should change /bin/bash to /bin/sh.
Created attachment 272680 [details] [review] run-in-tree.sh: Use sh rather than bash We don't really on bash-specific features so use /bin/sh rather than /bin/bash.
Please test the patch and see if it works with your shell. I tested with bash and dash.
This patch fix the problem, but there is another problem: test/gvfs-test use /usr/bin/python3 and we should change it to /usr/bin/env python3.
Comment on attachment 272680 [details] [review] run-in-tree.sh: Use sh rather than bash Looks like working also for ksh. Why the signal name change is needed?
Dash wasn't happy with SIGINT and SIGTERM. @Ting-Wei While there's no problem committing this patch, the test suite AFAIK isn't particularly portable and probably would require a lot more work getting it to run on other systems like FreeBSD.
Created attachment 273093 [details] [review] use #!/usr/bin/env python
(In reply to comment #5) > Dash wasn't happy with SIGINT and SIGTERM. > > @Ting-Wei While there's no problem committing this patch, the test suite AFAIK > isn't particularly portable and probably would require a lot more work getting > it to run on other systems like FreeBSD. Port to FreeBSD will be hard probably, but using /usr/bin/env could solve problems also for some linux distribution...
Review of attachment 273093 [details] [review]: Looks good, but may as well change test/test_polkitd.py as the same time.
Review of attachment 272680 [details] [review]: Ross, does gvfs-testbed works for you? Would be good to change it also in there if it is working...
Created attachment 273175 [details] [review] use #!/usr/bin/env python (In reply to comment #8) > Review of attachment 273093 [details] [review]: > > Looks good, but may as well change test/test_polkitd.py as the same time. Right, done.
Review of attachment 273175 [details] [review]: Looks good!
Comment on attachment 272680 [details] [review] run-in-tree.sh: Use sh rather than bash Pushed to master as e7795959f88872d1231c322a45d16264ada9f997. Thanks!
Remaining problem: test/gvfs-test => #!/usr/bin/python3 test/gvfs-test also contains other problems: ip: not found sed: 1: "/127\.0\.0/ n; /inet / ...": extra characters at the end of q command test/gvfs-testbed => #!/bin/bash test/test_polkitd.py => #!/usr/bin/python3
(In reply to comment #13) > Remaining problem: > > test/gvfs-test => #!/usr/bin/python3 > test/gvfs-test also contains other problems: > ip: not found > sed: 1: "/127\.0\.0/ n; /inet / ...": extra characters at the end of q command > > test/gvfs-testbed => #!/bin/bash > test/test_polkitd.py => #!/usr/bin/python3 See Ondrej's patch to fix the python3 issues (not committed yet).
Comment on attachment 273175 [details] [review] use #!/usr/bin/env python commit 6e72d1870dd9401dc5479e7bd40fb112b448dda1
(In reply to comment #13) > Remaining problem: > > test/gvfs-test => #!/usr/bin/python3 > test/gvfs-test also contains other problems: > ip: not found > sed: 1: "/127\.0\.0/ n; /inet / ...": extra characters at the end of q command > > test/gvfs-testbed => #!/bin/bash > test/test_polkitd.py => #!/usr/bin/python3 Which systems has those problems? Patches are welcome to fix remaining problems for your environment...
(In reply to comment #16) > (In reply to comment #13) > > Remaining problem: > > > > test/gvfs-test => #!/usr/bin/python3 > > test/gvfs-test also contains other problems: > > ip: not found > > sed: 1: "/127\.0\.0/ n; /inet / ...": extra characters at the end of q command > > > > test/gvfs-testbed => #!/bin/bash > > test/test_polkitd.py => #!/usr/bin/python3 > > Which systems has those problems? Patches are welcome to fix remaining problems > for your environment... FreeBSD 10.0-RELEASE has ifconfig, but it does not have ip. bash and python3 are installed in /usr/local, so we need to change it to /usr/bin/env bash and /usr/bin/env python3 for scripts to work on both GNU/Linux and FreeBSD.
Or we could change gvfs-testbed not to use bashisms.
(In reply to comment #18) > Or we could change gvfs-testbed not to use bashisms. There are a lot of other things in gvfs-testbed do not work on FreeBSD. /proc/$pid/status, mount --bind, stat -c, udev ...
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/228.