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

Re: curly brackets a bashism?



On Mon, Feb 11, 2002 at 08:40:28PM -0800, Craig Dickson wrote:
> > 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).
> 
> Which would be okay with me, but as Junichi points out, policy already
> has a more complete solution.

Limiting install scripts to what can be done on the boot floppies would be
silly, anyway.  (IMO.)

> All this is answered in policy 11.4:
> 
>    ...Thus, shell scripts specifying /bin/sh as interpreter should only
>    use POSIX features. If a script requires non-POSIX features from the
>    shell interpreter, the appropriate shell must be specified in the

This is true, policy or not--and package scripts that don't point at
bash sould be tested with a shell without bash's extensions, to make
sure they're really just sh scripts.  (If ash doesn't have a fully POSIX
sh mode, that's still not guaranteed, but it's better than just testing
it with bash.)

>    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).

7.2 describes Depends, and that's the obvious place to look for the answer to
the general question "should essential packages be dependencies?", of which
this is one particular example.  (I'd hope the answer is yes or no, and not
"yes, with the exception of packages providing shells for scripts".)

-- 
Glenn Maynard



Reply to: