lilypond-devel
[Top][All Lists]
Advanced

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

Re: Fix STEPMAKE_GET_VERSION for OpenBSD


From: peterc
Subject: Re: Fix STEPMAKE_GET_VERSION for OpenBSD
Date: Wed, 16 Dec 2009 11:40:36 +1100
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 MULE XEmacs/21.4 (patch 21) (Educational Television) (i486-linux-gnu)

>>>>> "Matthias" == Matthias Kilian <address@hidden> writes:

Matthias> On Tue, Dec 15, 2009 at 04:33:14PM +0100, Jan Nieuwenhuizen
Matthias> wrote:
>> > (I really > don't remember the reason, too much time has passed
>> since I made > this patch)
>> 
>> It would be nice to know why we need this, esp. as this fix does
>> not make the logic more readible.

Matthias> Not necessary, I aready had a closer look. It's failing in
Matthias> grep(1) for \|, which is undefined by POSIX (for basic
Matthias> regular expressions) and obviously support by GNU grep but
Matthias> not by OpenBSDs grep.

Matthias> So a much simpler fix is to use

Matthias>       grep -E '(^| )[0-9][0-9]*\.[0-9]'

Matthias> instead of

Matthias>       grep -E '\(^\| \)[0-9][0-9]*\.[0-9]'

Matthias> Here's a diff that does exactly this:


This is very complicated.  Why not just something like:

{  lilypond -V || lilypond --version; }  2>&1 |
        sed -n -e 's/^[^0-9.]*\([0-9][0-9]*\.[0-9][0-9.]*\).*$/\1/p'

If there could be more than one version then this:

{  lilypond -V || lilypond --version; }  2>&1 |
        sed -n '/[0-9][0-9*\.[0-9][0-9.]*/{
            s/^[^0-9.]*\([0-9][0-9]*\.[0-9][0-9.]*\).*$/\1/p'
            q
        }'
should do the trick.




reply via email to

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