Re: Proposed improved patch for yaird
On Sun, Oct 16, 2005 at 12:03:20PM +0200, Jonas Smedegaard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sun, 16 Oct 2005 08:30:41 +0200
> Sven Luther <sven.luther@wanadoo.fr> wrote:
>
> > On Sat, Oct 15, 2005 at 09:59:21PM +0200, Jonas Smedegaard wrote:
>
> > > -while getopts "d:km:o:r:" flag; do
> > > - case $flag in
> > > - d)
> > > - echo "$PROG: $flag unsupported"
> > > +TEMP=`getopt -o d:km:o:r: --long
> > > supported-host-version:,supported-target-version: -n "$prg" -- "$@"`
> >
> > Neat, but i guess that this syntax was not included in the getopt
> > documentation i found, or i would have used it.
>
> Beware of the difference between getopts (bash builtin)
> and /usr/bin/getopt
>
> See /usr/share/doc/util-linux/examples/getopt-parse.bash.gz (I pretty
> much just did a copy'n'paste from there) and getopt(1).
Ah, ... I looked at the bash-builtin one inded.
> > > +# Check for non-GNU getopt
> > > +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
> >
> > Is --long a NGNU getopt feature, and are we always guaranteed to have
> > such a thing ?
>
> Yes, GNU getopt is part of util-linux so I believe it is safe to rely
> on, yes.
Cool.
BTW, i uploadeda patched yaird to http://people.debian.org/~luther/ramdisk
too, so the set is complete, provided my kernel-package patch is not broken.
Friendly,
Sven Luther
Reply to: