[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r10868 - trunk/build/ac-macros

From: Ben Reser <ben_at_reser.org>
Date: 2004-09-10 21:00:01 CEST

On Fri, Sep 10, 2004 at 01:14:20PM -0400, Greg Hudson wrote:
> On Thu, 2004-09-09 at 20:49, breser@tigris.org wrote:
> > + if [ test -f "$where" ]; then
> > + if [ test ! -f "$SWIG" ] || [ test ! -x "$SWIG" ]; then
>
> The square brackets around the test commands are harmless in this
> context (they act as m4 quote characters in this context), but are
> confusing because you've written what at first glance appears to be
> invalid shell code.

Ahh you're right, I usually use the brackets instead of test and the m4
uses test for obvious reasons, so I just reflexivly typed the brackets
but was trying to use test.

I'll fix this.

> Also, the second statement is weird, firstly because it uses two test
> processes instead of -o,

I always forget that test supports -o. I'll change this as well.

> and secondly because the second test seems to
> subsume the first one (that is, just 'test ! -x "$SWIG"' would seem to
> do the job).

Look again. The first test is to see if the $where is a file, the
second test is to see if $SWIG is a file. Note that if $where is not a
file we assume it's the path to the prefix where SWIG was installed.
Thus we have to test twice.

I intentionally made the prefix path the default (the part in the else
clause) becuase we document --with-swig as wanting the prefix to where
SWIG is installed, so this causes the error message for a non-existant
path to have the bin/swig concated on it to give the user a clue as to
what they're expected to pass.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 10 21:00:23 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.