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

Re: Tightening up specification of /bin/sh

I apologize for the long delay in responding, I was sick.

On Sun, May 20, 2001 at 08:23:44PM +0200, Arthur Korn wrote:
> Can we change the last sentence in:
> > !       The standard shell interpreter `<tt>/bin/sh</tt>' is a
> > !       symbolic link to a POSIX compatible shell.  Since the POSIX
> > !       standard for shells leaves important areas unspecified,
> > !       wherever it is lacking, `<tt>/bin/sh</tt>' shall follow the
> > !       <em>consensus behavior</em> of other shell interpreters.
> > !       Consensus behavior is determined by testing at least five
> > !       shell interpreters which claim to be POSIX compatible.
> to
> "Consensus behavior is determined by testing all shells which
> register for the /bin/sh alternative in the distribution the script
> is meant for."

>From the point of view of an upstream author I am nervous about that.
I deliberately chose the number five to be greater than the number of
different POSIX shell implementations in Debian (bash, ash, pdksh)
because an upstream author trying to determine consensus behavior
would not limit testing to the shells in just one distribution of one
operating system.  

Also, how do you then distinguish a bug in one of Debian's shells
which causes it to break the consensus, from a situation where there
is genuinely no consensus?  The sample size is too small.

However, you do have a point.  It probably is too much to ask of an
arbitrary Debian maintainer that they have access to enough different
shell implementations to evaluate the rule as I phrased it, since (as
someone else pointed out) their priority is making Debian work
cohesively.  Upstream people have to worry about portability to many
different systems, which is a different, harder problem.

[I'm primarily an upstream maintainer (of gcc) myself, so I tend to
come at things from that point of view.]

Perhaps we could rephrase the proposal in terms of uniformity between
shells included in Debian and considered to be suitable alternatives
for /bin/sh (ignoring the fact that there is no /bin/sh alternative).
This would be a weaker constraint but should do acceptably well.
Something like

	The POSIX standard for shells leaves important areas
	unspecified.  In the interest of minimizing the number of
	scripts which are dependent on one particular implementation
	of the shell, all POSIX compatible shells included in Debian
	should behave identically for all features which are mentioned
	in the POSIX standard.  
	This is not intended to exclude extensions to the standard,
	only to constrain those features which POSIX mentions but does
	not fully specify.
	{ possibly examples here }

Do you think that would be better?

zw   Actually, we have scientifically determined that Heisenberg did indeed
     sleep exactly here. However, we have no idea whatsoever just how fast
     asleep he was.
     	-- Dave Aronson

Reply to: