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 726911 - #!/bin/bash in test/run-in-tree.sh
#!/bin/bash in test/run-in-tree.sh
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: build
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-23 06:20 UTC by Ting-Wei Lan
Modified: 2018-09-21 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
run-in-tree.sh: Use sh rather than bash (902 bytes, patch)
2014-03-23 06:45 UTC, Ross Lagerwall
committed Details | Review
use #!/usr/bin/env python (633 bytes, patch)
2014-03-27 14:09 UTC, Ondrej Holy
reviewed Details | Review
use #!/usr/bin/env python (942 bytes, patch)
2014-03-28 14:05 UTC, Ondrej Holy
committed Details | Review

Description Ting-Wei Lan 2014-03-23 06:20:51 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.
Comment 1 Ross Lagerwall 2014-03-23 06:45:05 UTC
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.
Comment 2 Ross Lagerwall 2014-03-23 06:45:59 UTC
Please test the patch and see if it works with your shell. I tested with bash and dash.
Comment 3 Ting-Wei Lan 2014-03-23 07:34:10 UTC
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 4 Ondrej Holy 2014-03-27 14:02:27 UTC
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?
Comment 5 Ross Lagerwall 2014-03-27 14:08:02 UTC
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.
Comment 6 Ondrej Holy 2014-03-27 14:09:38 UTC
Created attachment 273093 [details] [review]
use #!/usr/bin/env python
Comment 7 Ondrej Holy 2014-03-27 14:26:17 UTC
(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...
Comment 8 Ross Lagerwall 2014-03-27 14:30:03 UTC
Review of attachment 273093 [details] [review]:

Looks good, but may as well change test/test_polkitd.py as the same time.
Comment 9 Ondrej Holy 2014-03-28 14:01:34 UTC
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...
Comment 10 Ondrej Holy 2014-03-28 14:05:48 UTC
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.
Comment 11 Ross Lagerwall 2014-03-29 13:55:20 UTC
Review of attachment 273175 [details] [review]:

Looks good!
Comment 12 Ross Lagerwall 2014-04-11 16:55:35 UTC
Comment on attachment 272680 [details] [review]
run-in-tree.sh: Use sh rather than bash

Pushed to master as e7795959f88872d1231c322a45d16264ada9f997.  Thanks!
Comment 13 Ting-Wei Lan 2014-04-11 17:46:50 UTC
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
Comment 14 Ross Lagerwall 2014-04-11 17:55:51 UTC
(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 15 Ondrej Holy 2014-04-16 10:22:56 UTC
Comment on attachment 273175 [details] [review]
use #!/usr/bin/env python

commit 6e72d1870dd9401dc5479e7bd40fb112b448dda1
Comment 16 Ondrej Holy 2014-04-16 10:29:24 UTC
(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...
Comment 17 Ting-Wei Lan 2014-04-16 11:03:47 UTC
(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.
Comment 18 Ross Lagerwall 2014-04-16 11:12:36 UTC
Or we could change gvfs-testbed not to use bashisms.
Comment 19 Ting-Wei Lan 2014-04-16 11:57:46 UTC
(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 ...
Comment 20 GNOME Infrastructure Team 2018-09-21 17:40:44 UTC
-- 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.