Re: autconf, configure & purify...

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

 



Hi Eric,

* Eric Blake wrote on Fri, Oct 24, 2008 at 01:16:53PM CEST:
> According to Ralf Wildenhues on 10/24/2008 12:39 AM:
> >>   AC_CHECK_PROGS(PURIFY,purify purify2002)
> >>
> >>   if test -z $PURIFY; then
> > 
> > This however does need quoting: if $PURIFY can ever be empty, then the
> > shell will complain about a missing argument to 'test -z'.  So use
> >   if test -z "$PURIFY"; ...
> 
> Actually, if $PURIFY is empty, the test will still return exit status 0,
> since "-z" is a lone, non-empty argument.  Silent misbehavior is even
> worse than a shell complaint (you want exit status 1 if $PURIFY is empty).

Huh?  Several bits are going past each other here:

- the test is trying to test whether $PURIFY is empty.  As such the test
is correct, not false,

- many vendor shells complain about 'test -z' without further argument:
$ sh
$ test -z
test: argument expected
$ echo $?
1
$ uname -mrs
SunOS 5.10 sun4u

(IIRC purify was at one time sold for IRIX),

- independently of all of the above, you still need to quote $PURIFY,
otherwise things like
  PURIFY='whatever -o -n oh-more-args-for-test...'
do something you definitely did not intend.

Was that you replying, Eric?  ;-)

Cheers,
Ralf


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux