bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] bootstrap: handle perl-5.11's changed --version output


From: Jim Meyering
Subject: Re: [PATCH] bootstrap: handle perl-5.11's changed --version output
Date: Mon, 30 Nov 2009 11:14:48 +0100

Pádraig Brady wrote:

> Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> 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.
>> ...
>>>           #the following essentially does s/5.005/5.5/
>>>           s/\.0*\([1-9]\)/.\1/g
>> ...
>>
>> good catch!
>>
>> However, performing that substitution on a string like 5.010000
>> would give 5.10000.  Not what we want.
>
> Note no `perl --version` I know outputs 5.005002, it outputs

with F12's 5.10.0, I see this:

    $ perl -le 'print $]'
    5.010000

> 5.005_002 which will be truncated to 5.005 by our regex.
> So in general we would just be treating the version as ints delimited with '.'
>
>> Using $^V appears to be the solution:
>>
>>     $ perl -le '($v = $^V) =~ s/^v//; print $v'
>>     5.10.0
>>
>> Generally, I prefer to avoid using $_, but here it might be worthwhile
>> for the slight overall decrease in syntax:
>>
>>     $ perl -le '$_ = $^V; s/^v//; print'
>>
>> Opinions?
>
> I looked at $^V first but was dissuaded as
> I thought $^V was not available until perl 5.6?

Ahh.. I didn't check that.
Thanks!

> Also I thought it changed format recently
> (it doesn't work on 5.8 on solaris at least).

So $^V appears to be out.

Want to write the patch?
There must be something canonical and "easy" in Perl itself, considering
the prevalence of the desired version string, e.g. in perl's own search path.




reply via email to

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