[Slackbuilds-users] Patch proposal to remove bashisms from some scripts
dragonwisard at gmail.com
Tue Nov 2 04:27:14 UTC 2010
On Mon, Nov 1, 2010 at 9:07 AM, King Beowulf <kingbeowulf at gmail.com> wrote:
> I would say so.
> My 2 cents: SBo hosts packages for Slackware. Slackware default shell
> is bash. Slackbuild scripts should be bash compliant. Anything else
> is an exercise for the end user (eg dependency resolution etc).
Yes, the *default* shell is Bash, however not the _only_ shell. Having a
default does not, IMHO, excuse you from following the standard.
It would be perfectly valid to say, "SBo expects a full Slackware Install. A
full Slackware install includes /bin/bash. Therefore, all Slackbuild are
allowed to begin with #!/bin/bash". And, in fact, I would prefer that they
_do_ begin with /bin/bash if that was the only shell they were ever tested
However, I don't consider it valid to say, "SBo expects a full Slackware
Install. In the *default* install 'sh' is a symlink to 'bash'. Therefore,
all Slackbuilds are allowed to assume 'sh' and 'bash are the same thing."
You are at the same time acknowledging the existence of other shells (and
the fact that there are mechanisms in place to properly handle a multi-shell
environment) and dismissing that fact as unimportant because it would
require you to type two extra characters each time you wrote a Slackbuild.
Contrary to Mr. Beowulf, I think that, by default, we should comply with the
standard and use #!/bin/bash for scripts that were written and tested with
the assumption that they would be run in Bash. If someone wants to
explicitly (rather than implicitly) run the script in a different shell,
then we can leave THAT as an exercise to the individual user.
Speaking practically, however, I don't expect this to be enforced. It would
create a disproportionate burden on all maintainers and the SBo admins to
have to test that the correct shell is declared in the shebang. However I
think it would be reasonable to make a note of suggestion in the template or
on the submission page that Slackbuilds (like all shell scripts) that
specify 'sh' are expected to conform to pure Bourne Shell, and that it is
perfectly acceptable to specify 'bash' for you script instead.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SlackBuilds-users