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

Re: curly brackets a bashism?



On Tue, Feb 12, 2002 at 07:34:14AM +0900, Junichi Uekawa wrote:
> Craig Dickson <crdic@yahoo.com> cum veritate scripsit:
> 
> > The Debian boot floppies have ash, but not bash, because of size
> > concerns, so any package that might need to be installed from that
> > environment cannot use bashisms in its installation scripts. It seems
> > simpler to just say "no bashisms in package scripts" rather than
> > distinguish between those that might need to install when bash is not
> > available, and those that can depend on it. It would seem like asking
> > for trouble to say "no bashisms in base packages, but other than that
> > it's okay" -- people would tend to forget.

That would mean "you can't make package scripts *anything* but sh scripts"
(and any other shells/scripts available in the boot floppies, which are
probably few).

> Read policy section 11.4., and relax.
> 
> It is already documented as "/bin/sh can be any POSIX-compliant shell".
> 
> Not /bin/bash, not /bin/ash.

The point is that people are using "#!/bin/sh" and using bash-specific
features, which happens to work if your /bin/sh happens to be bash, but
not if it's anything else.  For people testing these, it'd help if /bin/sh
pointed to a shell with no extentions (or with them all disabled), so
this is enforced.

I'm not saying that people should never use bash features; just that the
bangline should be /bin/bash, not /bin/sh.

Aside: bash, bison, cvs, libc6, menu, postgresql, postgresql-client,
postgresql-doc, and libpgsql2.1 have scripts with #!/bin/bash,
but none of them depend on bash; is this a bug, or are essential
dependencies normally omitted?  (What about pre-deps for packages using
bash in preinst?)

/var/lib/dpkg/info/cvs.postrm:#!/bin/bash
/var/lib/dpkg/info/postgresql.postrm:#!/bin/bash

Same deal with at, console-common, console-data, kernel-headers-2.0.36,
kernel-source-2.0.36, libpaperg, postfix, and sudo for perl.

-- 
Glenn Maynard



Reply to: