FS#20557 - Use bash in scriplet calls

Attached to Project: Pacman
Opened by Andrej Gelenberg (nikel) - Saturday, 21 August 2010, 17:44 GMT
Last edited by Allan McRae (Allan) - Sunday, 22 April 2012, 11:22 GMT
Task Type Support Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 3.4.0
Due in Version 4.1.0
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Use /bin/bash for all scriplets (for example .INSTALL and other). At the moment scriptlets are called with /bin/sh and some sriptlets assume that /bin/sh is bash. If you set /bin/sh to dash some of the .INSTALL scripts fail due syntax error. So my patch run all stuff with bash, so you don't need to rewrite all install-scripts to get it dash compatible.

Why dash as /bin/sh: https://wiki.ubuntu.com/DashAsBinSh.
This task depends upon

Closed by  Allan McRae (Allan)
Sunday, 22 April 2012, 11:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  Scriplet shell can be selected at configure time: commit 3ba53918
Comment by Xavier (shining) - Saturday, 21 August 2010, 18:26 GMT
The patches on my working branch would make this patch much simpler (just s/sh/bash).
http://code.toofishes.net/cgit/xavier/pacman.git/log/?h=working
Comment by Andrej Gelenberg (nikel) - Saturday, 21 August 2010, 21:17 GMT
Done.
Comment by Xavier (shining) - Saturday, 21 August 2010, 21:26 GMT
This doesn't sound too bad to me.

But now I finally found the last reference I have on the topic (this issue has been discussed many times already) :
http://mailman.archlinux.org/pipermail/pacman-dev/2010-May/010914.html
and as you can see, Dan and Allan would like to avoid forcing the need of bash in pacman.

But rather allowing to put this at the top of all our scriptlets :
#!/bin/bash

I have no idea what work was done on that, just wait for a status update.
Comment by Allan McRae (Allan) - Saturday, 21 August 2010, 21:48 GMT
Dan had some prototype code (and a python install scriptlet!) from memory. No idea what happened to it...
Comment by Andrej Gelenberg (nikel) - Saturday, 21 August 2010, 22:18 GMT
I think, it should be no much work to rewrite the install scripts, but at the moment there quite some of them, which assume bash as /bin/sh. It would be nice, if a can use dash as /bin/sh.

My other task was defer this until such a decision is formally made, what install scripts should be sh complain (or not): http://bugs.archlinux.org/task/20464.

IMHO it would be better, if all install scripts should be sh complain (with dash as /bin/sh it would make all stuff bit faster). I could fix the install scripts in abs, if this help.

I can help with init scripts too, to get them work with dash.

(greetings from FrOSCon)
Comment by Allan McRae (Allan) - Saturday, 21 August 2010, 22:21 GMT
The reason for putting the #! at the top of install scripts is that way we do not have to worry about compatibility with every single shell someone decides to change the /bin/sh symlink to point at...

BTW, the initscripts use #!/bin/bash and rely heavily on bash specific features (and are moving further in that direction).

Loading...