Re: Proposed new POSIX sh policy
On Wed, 15 Nov 2006 17:15:14 -0800, Russ Allbery <firstname.lastname@example.org> said:
> Bruce Sass <email@example.com> writes:
>> On Wed November 15 2006 16:45, Russ Allbery wrote:
>>> No, but Policy currently requires scripts that use features not
>>> available from POSIX to declare an appropriate shell, and POSIX
>>> doesn't guarantee the binary -a operator.
>> Since all sh's in Debian provide compatible binary -a operators,
>> #!/bin/sh is appropriate when that operator is used and Policy is
>> being violated. Ya?
> I suppose you could read it that way, but I think that's strained.
> The standard shell interpreter /bin/sh can be a symbolic link to
> any POSIX compatible shell, if echo -n does not generate a
> newline. Thus, shell scripts specifying /bin/sh as
> interpreter must only use POSIX features. If a script requires
> non-POSIX features from the shell interpreter, the appropriate
> shell must be specified in the first line of the script (e.g.,
> #!/bin/bash) and the package must depend on the package
> providing the shell (unless the shell package is marked
> "Essential", as in the case of bash).
> I'd rather make the situation clearer.
I would rather get away from this wording totally.
| "Shell scripts specifying /bin/sh as interpreter must only use POSIX
| features, additionally, they may assume that echo -n .... . Also,
| they may use test -a/o and the local directive in shell functions,
| as long as .... If a shell script uses features beyond this set
| listed, then the appropriate shell must be specified in the first
| line of the script (e.g., #!/bin/bash) and the package must depend on
| the package providing the shell (unless the shell package is marked
| "Essential", as in the case of bash). "
This does specify what the scripts may expect, but drops all
wording from this section regarding what the policy expectation of
Necessity has no law. St. Augustine
Manoj Srivastava <firstname.lastname@example.org> <http://www.debian.org/~srivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C