[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#490604: debian-policy: please don't state that scripts working under dash are 'probably' policy-compliant



Jonathan Nieder <jrnieder@gmail.com> writes:

> I tend to find checking syntax ($shell -n) and running with "bash",
> "dash", "mksh", and "ksh93" more useful than posh for checking that a
> script is portable to the main POSIX-style shells in common use.

I certainly understand your point here, but I think this is the kind of
thing where we can make the wording more and more elaborate and drift away
from the point of Policy.  Normally we don't make these sorts of
recommendations at all and leave them to other guides.  This one is here
partly for historical reasons, so I'd like to make it accurate, but I'm
not horribly enthused about maintaining a list of additional shells that
people should try their scripts with.

There are a lot of limitations of $shell -n as well.  Several of the
things you note won't actually be caught by it.

I think checkbashisms and posh are an improvement over just suggesting
bash (and checkbashisms, in particular, is much easier to use), so my
inclination is to stick with the new wording and leave the further details
for other tools.  In particular, have you considered filing the following:

>  - "printf '\xc3\xa4\n'" (Neither posh nor checkbashisms catches it)

>  - 'var=newval function_call; echo $var' (Neither posh nor
>    checkbashisms catches it).  Yes, the dash/ksh93 behavior is
>    explicitly permitted in POSIX.

>  - 'var=$((echo hi) | head)' (Neither posh nor checkbashisms catches it)

as bug reports against posh so that posh will "break" more non-portable
shell scripts?

Some of these may also be good bug reports against checkbashisms, although
a few of them are very difficult to check in that framework.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: