[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test && test --> test -a
From: |
Gary V. Vaughan |
Subject: |
Re: test && test --> test -a |
Date: |
Wed, 5 Dec 2001 02:11:52 +0000 |
User-agent: |
Mutt/1.3.22.1i |
AFAIK `test -a' and `test -o' are supported by all modern platforms, and
what's more, require one less call to fork compared to && or ||. I
suppose there may be some archaic platforms that technically don't
support these operators, but no one has complained specifically about
other uses in ltmain.sh.
I believe there is a portability gotcha if more than two terms are
combined with -o and -a since the precedence it not consistent across
the platforms that implement it: you might get correct mathematical
precedence, or you might get straight left to right.
IMHO it is okay to use *one* -o or -a in each `test' clause, but no
more.
Cheers,
Gary.
On Mon, Dec 03, 2001 at 03:12:53PM -0600, Robert Boehne wrote:
> Jens:
>
> As I see it currently, this patch will have no effect aside from
> uncovering the platforms that don't support test -a.
>
> Robert -- the skeptical Libtool maintainer
>
> Jens Petersen wrote:
> >
> > A small trvial thing, but here it is. -Jens
> >
> > 2001-12-03 Jens Petersen <address@hidden>
> >
> > * ltmain.in: Remove last remaining "test ... && test ...".
> >
> > Index: ltmain.in
> > ===================================================================
> > RCS file: /cvsroot/libtool/libtool/ltmain.in,v
> > retrieving revision 1.284
> > diff -u -r1.284 ltmain.in
> > +++ ltmain.in 2001/12/03 10:04:55
> > @@ -3287,7 +3287,7 @@
> > $show "$mkdir $xdir"
> > $run $mkdir "$xdir"
> > status=$?
> > - if test "$status" -ne 0 && test ! -d "$xdir"; then
> > + if test "$status" -ne 0 -a ! -d "$xdir"; then
> > exit $status
> > fi
> > $show "(cd $xdir && $AR x $xabs)"
> >
> > _______________________________________________
> > Libtool-patches mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/libtool-patches
>
--
())_. Gary V. Vaughan gary@(oranda.demon.co.uk|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
- test && test --> test -a, Jens Petersen, 2001/12/03
- Re: test && test --> test -a, Robert Boehne, 2001/12/03
- Re: test && test --> test -a, Jens Petersen, 2001/12/04
- Re: test && test --> test -a, Robert Boehne, 2001/12/04
- Re: test && test --> test -a, Tim Van Holder, 2001/12/04
- Re: test && test --> test -a, Kevin Ryde, 2001/12/04
- Re: test && test --> test -a, Tim Van Holder, 2001/12/05
- Re: test && test --> test -a, Robert Boehne, 2001/12/05
- Re: test && test --> test -a, Brad, 2001/12/04
Re: test && test --> test -a,
Gary V. Vaughan <=