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

Bug#539158: Bug#490605: Bug#532324: udev init script bash+dashism: assumes printf is a builtin



On Wed, Jul 29, 2009 at 01:25:48PM +0000, Thorsten Glaser wrote:
> ① udev in sid will be changed to use "#!/bin/dash" as shebang;
>   udev in lenny will be changed to use "#!/bin/bash" as shebang.
>   The change in lenny is necessary, as it is affected as well.

> ② udev in both sid and lenny will be changed to not use printf
>   any more.

> Both ① and ② need to override the maintainer’s decision.
> I would be most pleased if one of the above were to be decided upon.

For my part, I reject both of these; we had a discussion yesterday among
four members of the TC present at DebConf, and there is a clear consensus
that "echo" should be considered deprecated in favor of printf (at least in
certain cases), so we should not override the maintainer for using it.

> ③ coreutils will be changed to move /usr/bin/printf to /bin/printf
>   and have a /usr/bin/printf@ → ../../bin/printf symbolic link.

>   I do not like this. It is non-standard, an evil workaround, and
>   will(!) lead to the creation of more unportable scripts.

This has the consequence of increasing the footprint of the root partition
for all users, not just those who opt to install mksh.  I don't think this
is the appropriate tradeoff.

> ④ dash will be changed to have the printf builtin removed, so that
>   maintainers will be forced to change their scripts.

>   I do not like this. Debian uses dash to provide a rather minimal
>   /bin/sh for quick system startup. While the presence of a printf
>   builtin is a speed hack, it serves this purpose well. Other shells,
>   including bash, ksh93, mksh and posh, but not pdksh, can be used
>   to validate scripts instead.

This is definitely the wrong answer.

> ⑤ Debian changes policy to allow the use of bash+dash as /bin/sh.

>   I do not like this, for similar reasons as in ③, as well as for
>   the fact that I fought to have mksh an allowed /bin/sh in Debian,
>   which has led to improvements upstream. These may be personal,
>   but I expect this proposal to be rejected due to the unportabi-
>   lity argument.

I don't think we would ever want to phrase this in terms of "bash+dash", but
certainly if there are built-ins common to these implementations, that we
have a specific reason for wanting to let scripts rely on (e.g.: printf
obsoletes echo in some cases, and echo is a required built-in), then that
should be documented in Policy.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org



Reply to: