Bug 6407 - [CTDB] Please fix bashisms in shell scripts
[CTDB] Please fix bashisms in shell scripts
Status: RESOLVED FIXED
Product: CTDB 2.5.x or older
Classification: Unclassified
Component: ctdb
unspecified
Other Linux
: P3 normal
: ---
Assigned To: Ronnie Sahlberg
Michael Adam
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-25 12:23 UTC by Mathieu Parent
Modified: 2011-10-15 13:46 UTC (History)
2 users (show)

See Also:


Attachments
Fix bashism (2.29 KB, patch)
2009-05-25 12:25 UTC, Mathieu Parent
no flags Details
Fix bashism (3.22 KB, patch)
2009-05-25 16:13 UTC, Mathieu Parent
no flags Details
Fix a bashism in 11.natgw (765 bytes, patch)
2009-09-26 04:27 UTC, Mathieu Parent
no flags Details
Fix some more bashisms (1.67 KB, patch)
2010-03-04 09:12 UTC, Mathieu Parent
math.parent: review?
Details
Fix bashism in config/events.d/60.ganesha (655 bytes, patch)
2011-03-23 21:30 UTC, Mathieu Parent
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Parent 2009-05-25 12:23:45 UTC
See attached patch.

From Debian bug: http://bugs.debian.org/530064
Comment 1 Mathieu Parent 2009-05-25 12:25:12 UTC
Created attachment 4203 [details]
Fix bashism
Comment 2 Mathieu Parent 2009-05-25 16:13:26 UTC
Created attachment 4204 [details]
Fix bashism
Comment 3 Michael Adam 2009-09-15 06:39:25 UTC
All bits except (as I just noticed) the patch to 00.ctdb have been pushed upstream and will be in 1.0.91 if I am not mistaken.

Michael
Comment 4 Michael Adam 2009-09-15 06:58:46 UTC
About the 00.ctdb bit:

you check for the existence of the time command with the sequence
"command -v time" .
How portable is it?
It is in bash, it is in dash (i.e. POSIX shell?)
But is it also in vanilla "sh"?

Ronnie, Mathieu, What to do about that?

Michael
Comment 5 Mathieu Parent 2009-09-15 10:38:39 UTC
(In reply to comment #4)
> About the 00.ctdb bit:
> 
> you check for the existence of the time command with the sequence
> "command -v time" .

I don't use this part of the patch (see http://svn.debian.org/wsvn/pkg-samba/trunk/ctdb/debian/patches/50-fix-bashism.diff) as the package now installs the "time" package.
Comment 6 Michael Adam 2009-09-17 15:59:23 UTC
Ok, so I think we can close this bug, right.
The submitted patches will be in 1.0.91.

Mathieu - please reopen if problems persist.

Michael
Comment 7 Mathieu Parent 2009-09-23 11:24:34 UTC
I'm reopening.

There is one more in events.d/11.natgw:
- if [ "$NATGWMASTER" == "-1" ]; then
+ if [ "$NATGWMASTER" = "-1" ]; then

Comment 8 Mathieu Parent 2009-09-26 04:27:08 UTC
Created attachment 4753 [details]
Fix a bashism in 11.natgw
Comment 9 Michael Adam 2009-11-20 18:37:38 UTC
(In reply to comment #8)
> Created an attachment (id=4753) [details]
> Fix a bashism in 11.natgw

This has been included in 1.0.105
Comment 10 Mathieu Parent 2009-11-21 03:56:43 UTC
> This has been included in 1.0.105

Thanks!
Comment 11 Mathieu Parent 2010-03-04 09:12:49 UTC
Created attachment 5458 [details]
Fix some more bashisms
Comment 12 Mathieu Parent 2010-03-04 09:13:25 UTC
Reopening. https://bugzilla.samba.org/attachment.cgi?id=5458 should be applied
Comment 14 Mathieu Parent 2011-03-23 21:29:23 UTC
I'm reopening this one. See attached patch 0001-Fix-bashism.patch.
Comment 15 Mathieu Parent 2011-03-23 21:30:06 UTC
Created attachment 6342 [details]
Fix bashism in config/events.d/60.ganesha
Comment 16 Michael Adam 2011-05-14 20:34:25 UTC
(In reply to comment #15)
> Created attachment 6342 [details]
> Fix bashism in config/events.d/60.ganesha

thanks.
pushed to master.

Ronnie: This applies to the 1.2 branches.
I suggest picking it for the releases.

==> assigning to Ronnie.