On Fri, Oct 03, 2014 at 09:39:29AM +1000, Russell Stuart wrote: > IMO, if Debian has decided the in the default case /bin/sh ==> dash, > then the policy should say "#!/bin/sh scripts" must work with dash. It > then becomes trivial for Developers to test their code conforms with > policy. If we allow /bin/sh to be linked to other shells, policy should > say those shells must implement all the features /bin/dash implements so > that any script that works with dash must also work with them.
This isn't possible, as there are some corner cases in which dash and bash work differently, and those are both explicitly supported choices for /bin/sh. These areas are in extensions that are not part of POSIX or the extended set of features required by Policy. > As is stands, the one thing you can guarantee we will get from our > policy saying "#!/bin/sh" scripts work with a shell that does not exist > and can't be tested against is scripts that have never been tested > against that policy. The set of features that Debian's /bin/sh must support is fairly limited. It's not very difficult at all to implement a shell script appropriately. Every shell script I write these days will work in bash, dash, and posh, whether I'm writing it to run on a Debian system or not. > If Debian really wants to implement the policy as described, then it > should do the work required to produce robust software that conforms > with it. In this case that would mean producing a shell that behaves as > described, which we make /bin/sh by default. Perhaps a flag to dash > stripping all of the features not described in SUSv3 features would > suffice. The shell you're describing is posh. It implements exactly those features, and nothing more. Unfortunately, some developers have outright refused to make their software using /bin/sh work with posh, even when provided with a patch (e.g. #309415), to the point that last time I tried to use posh as /bin/sh, the system wouldn't boot. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
signature.asc
Description: Digital signature