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

Re: /etc/shells management



On Mon, Sep 08, 2003 at 11:18:44PM -0600, Bob Proulx wrote:
> Colin Watson wrote:
> > Adam Heath wrote:
> > > Guido Guenther wrote:
> > > > Just of out curiosity, is this in any way different from the shorter:
> > > > if [ "$var" ]; then
> > > 
> > > var="-f"
> > 
> > Have you tried that? No POSIX shell will have a problem.
> 
> You are confusing standards with portability.  They are not the same
> thing.
> 
> See my other posting for a real world example of this particular
> construct which fails on a shell on a commercial system which claims
> to be a POSIX shell.  It probably is compliant to an older version of
> the standard.  But standards change over time and just by standing
> still you fall behind.  This particular construct is not portable to
> that system regardless of the presence of standards.
> 
> I am not saying that Debian dpkg scripts should worry about strange or
> non-standard systems, nor indeed any non-Debian systems at all.  I am
> just talking about portable script style and advocating defensive
> programming in general.

Since I'm talking exclusively about postinst scripts, though, I see
absolutely no reason why we shouldn't use cleaner and more
understandable POSIX interfaces where they're available. When
programming specifically for Debian I do not want to worry about the
vagaries of ancient non-free operating systems. Programming to standards
is good enough.

I'm not confusing standards with portability - I'm aware that certain
legacy systems have problems with this construct - but I choose not to
care in this instance.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: