On Fri, Oct 19, 2007 at 05:26:46PM +0800, Herbert Xu wrote:
> Oleg Verych <[EMAIL PROTECTED]> wrote:
> > 
> > == Proposition A. Do not implement `-a' and `-o'. ==
> 
> I sympathise with your view Oleg.  Indeed, if you raised this
> a few years back I'd have removed it with no hesitation :)
> 
> Unfortunately these days there are too many systems that already
> use dash out there (mostly Debian + Ubuntu) that have loads of
> scripts on them that use -a or -o.
> 
> There's no way that we can get away with just breaking these
> scripts.

OK, i don't want to break anything, just bring this to the table.

So. What about, that `coreutils' is "Essential: yes" stuff? I.e.
`exec /usr/bin/test` will work anyway.

Early userspace. OK, lets see:


$ grep -e '\[' -e 'test ' * | grep --color=auto -e ' -o ' -e ' -a ' | {
  while read A B ; do echo $A; done;
}

alsa-utils:
aumix:if
aumix:if
console-screen.sh:
hdparm:
ifupdown-clean:
makedev:
openbsd-inetd:[
pure-ftpd:
udev:
udev:
udev:
[EMAIL PROTECTED]:/etc/init.d$

So (as usual) udev can be in trouble. BR+patch, no problem, i guess.
A change in the Debian automatically goes to Ubuntu.

initramfs:

$ mkdir 7 ; cd 7 ; gunzip -c /boot/initrd.img-2.6.18-4-amd64 | cpio -i
32860 blocks
$ grep -e '\[' -e 'test ' * | grep --color=auto -e ' -o ' -e ' -a '
$ echo '[ -z 1 -o -e /dev/null ]' >>init
$ grep -e '\[' -e 'test ' * | grep --color=auto -e ' -o ' -e ' -a '
init:[ -z 1 -o -e /dev/null ]
$


> > == Proposition B. Extend `-ot' and `-nt' to check a list of files. ==
> > 
> > This are not POSIX ops, described in [0] as to be not included from
> > original KornShell, due to not including `[[' semantics.
> > 
> > Nonetheless, they are present in `dash` and in other implementations.
> > Maybe because of [0]:
> > 
> >     Additional implementation-defined operators and primary_operators
> >     may be provided by implementations. They shall be of the form -
> >     operator where the first character of operator is not a digit.
> > 
> > Now, i want to add something like this:
> > 
> > #!/bin/dash
> > cd /mnt/path/to/src
> > 
> > test file.c -ot [ utils/foo.c include/bar.h ] && do_update
> > [ file.c -nt [ utils/foo.c include/bar.h ] ]  || do_nothing
> > 
> > test vmlinux.o -nt [ $DEP_LIST ] || do_something
> 
> It looks neat but I'm not convinced that we need this feature.
> I have two reasons for this:
> 
> 1) This can just as easily be done in a script:
[]
> 2) POSIX does not require this.
> 
> In other words, I would consider a new feature for dash if it
> is either required by POSIX or if it's useful enough and that
> it can't easily be done using existing shell primitives.

Well, i've wrote about that. There was paragraph:

> >This change is not going to be major, because now it is possible to
> >multiply calls or using -a' || -o'. But going to be very good
> >optimization for such kinds of applications.

_Optimization_, i.e. to do not call stat() on the same file on and on.
This is just silly.
____
-
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to