[MPlayer-dev-eng] [PATCH] clean up tests in configure

Ivan Kalvachev ikalvachev at gmail.com
Fri Jul 1 23:20:28 CEST 2005


On 6/30/05, Zoltan Hidvegi <mplayer at hzoli.2y.net> wrote:
> Diego Biurrun wrote:
> > > > But if we should choose to have faster configure and to have easy to
> > > > read&modify configure I choose the second.
> > >
> > > I choose the former. :) It's already too damn slow like autosh*t...
> >
> > I don't agree in principle but I don't see how -a/-o is less readable than
> > &&/||.  It's shorter and faster so it should be preferred.
> 
> There is hardly any speed difference between -a/-o vs. &&/|| if you
> use {...} for scoping instead of (...).  This is getting a bit off
> topic, but the problem with -a/-o is that it can be ambiguous:
> 
> test "$foo" = "$bar" -a -z "$x"
> 
> And suppose that foo=-a bar=-o x=1, so it expands to:
> 
> test -n = -a -a -z 1
> 
> And this can be parsed as test (-n =) -a (-a -z 1) which is a syntax
> error.  Sure, this does not happen often, and may never happen in
> mplayer's configure script, but exactly because of these ambiguities
> POSIX does not define -a/-o and recommends the use of &&/|| instead.
> And also that's why you often see
> 
> test "x$foo" = "x$bar"
> 
> which ensures that there is no ambiguity.
> 
> Zoli

I think this is enough reason to reject the patch.
As for the rest of 'cleanups' I think that they could be trown away in
favor of the proposed change from () to {} . {faster speed while more
readable}.

We are waiting for the next patch.

Ivan Kalvachev
  iive


p.s.
Note that i am not script kiddy.  I don't know if /bin/sh do have
`test` buildin, or if bash 0.1 had it. I just took the worst possible
case.




More information about the MPlayer-dev-eng mailing list