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. 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? >From 80d644f6786b65499a52960ede494de43fbf443f Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Mon, 30 Nov 2009 07:42:16 +0100 Subject: [PATCH] bootstrap: perl version: use $^V (without the leading "v") not $] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build-aux/bootstrap (get_version): Use Perl's $^V, not $] (e.g., v5.10.0, not 5.010000) to get a version string in the required form. Reported by Pádraig Brady. --- ChangeLog | 7 +++++++ build-aux/bootstrap | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d04361..479831d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-30 Jim Meyering <meyer...@redhat.com> + + bootstrap: perl version: use $^V (without the leading "v") not $] + * build-aux/bootstrap (get_version): Use Perl's $^V, not $] + (e.g., v5.10.0, not 5.010000) to get a version string in the + required form. Reported by Pádraig Brady. + 2009-11-29 Jim Meyering <meyer...@redhat.com> bootstrap: handle perl-5.11's changed --version output diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 7c4882d..d6f882f 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -314,7 +314,7 @@ get_version() { # perl 5.11's --version output does not fit the mold, # handle perl as a special case. if test "_$app" = _perl; then - perl -le 'print $]' || return 1 + perl -le '($v = $^V) =~ s/^v//; print $v' || return 1 return 0 fi -- 1.6.6.rc0.308.g2d025