Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: Problems detecting automake version.
Home

[Freeciv-Dev] Re: Problems detecting automake version.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Problems detecting automake version.
From: "Baumans" <baumans@xxxxxxxxxxxxx>
Date: Tue, 19 Aug 2003 15:49:29 -0400

----- Original Message ----- 
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
To: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Cc: <freeciv-dev@xxxxxxxxxxx>
Sent: Tuesday, August 19, 2003 2:46 PM
Subject: [Freeciv-Dev] Re: Problems detecting automake version.


> On Tue, 19 Aug 2003, Marko Lindqvist wrote:
> > >-pkg_version=`$PACKAGE --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/
.*$//'`
> > >+pkg_version=`$PACKAGE --version|head -n 1|sed
's/(.*)//;s/^[a-zA-Z\.\ ]*//;s/ .*$//'`
> > >
> > >Can you please explain what you are trying to do above?
> ...
> > When cutting actual version number from 'program --version' output,
> > ignore everything inside brackets and brackets themselves (for first
> > brackets). This way there can be another kind of version number inside
> > brackets without version number detection getting fooled by it. Inside
> > brackets is often name of the operating system packet program is part
of.
>
> Ah. But you can accidentially delete too much, since sed is so greedy. For
> example the version string "test version (linux) 1.15.0 (beta-1)" will be
> correctly parsed by the current sed magic, while your new one will fail.
>
How about:
 s/([^)]*)//g;
That appears to make it nongreedy (in my test, the "g" seemed to be
optional).
> I have no good suggestions. Maybe we should use perl? ;)
>
>   - Per
>
> "The truth is there is an ideological struggle between those who believe
> that the best way to grow the economy is to give more money to the
> wealthy, and the Democrats who believe that the wealthy will make more
> money if average people do better." -- Bill Clinton, November 2000
>
>
>



[Prev in Thread] Current Thread [Next in Thread]