[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] bootstrap: handle perl-5.11's changed --version output
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] bootstrap: handle perl-5.11's changed --version output |
Date: |
Mon, 30 Nov 2009 01:17:11 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Jim Meyering wrote:
> I've built and have been experimenting with perl 5.11.2+
> and hit a little snag: bootstrap was unable to extract
> the version number from its new --version output.
> To address that, I've changed bootstrap to special-case perl:
That looks good, the caveat being that all projects
with specifications of perl in bootstrap.conf must be
updated to the new format.
Note I just noticed there was an issue with the perl-5.5 dependency
specification in coreutils::bootstrap.conf as on perl 5.5.x
systems one would have got:
Error: 'perl' version == 5.005 is too old
'perl' version >= 5.5 is required
One could also handle both of these issues with
this updated get_version(), the advantage being that
no bootstrap.conf files need to be updated. Also all
version specs would be of a consistent format.
get_version() {
app=$1
$app --version >/dev/null 2>&1 || return 1
$app --version 2>&1 |
sed -n '# extract version within line
s/.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
t done
# extract version at start of line
s/^\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
t done
d
:done
#the following essentially does s/5.005/5.5/
s/\.0*\([1-9]\)/.\1/g
p
q'
}
I'll leave the decision to you.
cheers,
Pádraig,