Dash.

Dan Nicholson dbn.lists at gmail.com
Fri Mar 16 10:53:24 PDT 2007


On 3/16/07, Dan Nicholson <dbn.lists at gmail.com> wrote:
> On 3/16/07, Randy McMurchy <randy at linuxfromscratch.org> wrote:
> > Dan Nicholson wrote these words on 03/16/07 09:27 CST:
> >
> > > It just needs some LFS boilerplate at the top. That's everything
> > > upstream + LC_ALL=C in the mkbuiltins script that I sent him and he
> > > said he would apply.
> >
> > How many patches are there? I am not a fan of making global patches
> > to include many different patches (sometime it cannot be avoided).
> >
> > I would prefer not to do the LC_ALL=C thing in patch, though. If
> > it must be a patch, it would have to be a separate one.
>
> There are ~8 commits upstream since 0.5.3. Most of them are bug fixes
> that we might want, but some seem like they are trivial corner cases.
> Ubuntu only applies two of the commits, and they use dash as /bin/sh.

I made a new patch that just has the two commits Ubuntu includes.

http://www.linuxfromscratch.org/~dnicholson/patches/dash-0.5.3-fixes-1.patch

Here are the log entries for those two commits. The second seems to
definitely be needed.

commit d8014392bc291504997c65b3b44a7f21a60b0e07
Author: Herbert Xu <herbert at gondor.apana.org.au>
Date:   Sun Apr 23 16:01:05 2006 +1000

    [PARSER] Only use signed char for syntax arrays

    The existing scheme of using the native char for syntax array indicies
    makes cross-compiling difficult.  Therefore it makes sense to choose
    one specific sign for everyone.

    Since signed chars are native to most platforms and i386, it makes more
    sense to use that if we are to choose one type for everyone.

commit e5f903b9451c6e6a79eee939fcf6558a0b93cf8e
Author: Herbert Xu <herbert at gondor.apana.org.au>
Date:   Thu Jan 12 21:02:26 2006 +1100

    [EVAL] Make eval with empty arguments return 0

    On Tue, Jan 10, 2006 at 10:56:23AM +0000, Gerrit Pape wrote:
    > tags 347232 + patch
    > quit
    >
    > On Mon, Jan 09, 2006 at 04:29:19PM +0100, Marco Nenciarini wrote:
    > > The problem is here:
    > >
    > > # Set the kernel 2.6 option only for fresh install
    > > test -z "$(GetMenuOpt "kopt" "")" && kopt_2_6="root=$root_device_2_6 ro"
    > >
    > > # Extract options for specific kernels
    > > eval $(ExtractMenuOpts "\(kopt_[a-zA-Z0-9_]\+\)")
    > >
    > > If the first test fails and the eval argument is empty then dash
    > > terminate with exitcode 1.
    >
    > > This is a simple testcase:
    > > tm:~# bash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $?
    > > END
    > > 0
    > > tm:~# dash -c "set -e ;/bin/false && : ; eval ''; echo 'END'"; echo $?
    > > 1
    > >
    > > if you insert any command with successfull exit status before the
    > > empty eval, all work ok:
    > > tm:~# bash -c "set -e ;/bin/false && : ; : ; eval ''; echo
'END'"; echo $?
    > > END
    > > 0
    > > tm:~# dash -c "set -e ;/bin/false && : ; : ; eval ''; echo
'END'"; echo $?
    > > END
    > > 0
    >
    > Yes, I can confirm this is a bug in dash.  The standard says
    >
    >  EXIT STATUS
    >
    >      If there are no arguments, or only null arguments, eval shall
    >      return a zero exit status; otherwise, it shall return the exit
    >      status of the command defined by the string of concatenated
    >      arguments separated by <space>s.
    >
    > Hi Herbert, please see http://bugs.debian.org/347232

    Changed evalstring to return the exit status instead of evalskip.  This
    allows us to return zero if the string is empty.

--
Dan



More information about the blfs-dev mailing list