summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Peacock <john.peacock@havurah-software.org>2014-02-03 07:48:57 -0500
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-02-03 13:07:56 +0000
commitd2b110e6a5467455bc4a3d333ec4f1abc5383bd8 (patch)
treecec99ae085f694aab049ad0fc95aca7e696dbfce
parent3c075feabc1b777553a63a5a7d87ef482f2e3d49 (diff)
downloadperl-d2b110e6a5467455bc4a3d333ec4f1abc5383bd8.tar.gz
Sync bleadperl to version.pm 0.9908
Attached is a patch to bring blead up to date with the latest CPAN release of version.pm 0.9908. All tests pass (except the expected porting/customized.t). I'm hopeful that this will be the last update for a while. Thanks to Daniel Dragan for his insistent prodding to improve the code. ;-) Thanks John >From c501530aa386a3ccbdb35bcccbccd35d70315651 Mon Sep 17 00:00:00 2001 From: John Peacock <jpeacock@cpan.org> Date: Sun, 2 Feb 2014 11:57:44 -0500 Subject: [PATCH] Update bleadperl to CPAN 0.9908 release Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
-rw-r--r--cpan/version/lib/version.pm2
-rw-r--r--cpan/version/lib/version/regex.pm2
-rw-r--r--cpan/version/lib/version/vpp.pm125
-rw-r--r--cpan/version/t/00impl-pp.t2
-rw-r--r--cpan/version/t/01base.t2
-rw-r--r--cpan/version/t/02derived.t2
-rw-r--r--cpan/version/t/03require.t2
-rw-r--r--cpan/version/t/05sigdie.t2
-rw-r--r--cpan/version/t/06noop.t2
-rw-r--r--cpan/version/t/07locale.t4
-rw-r--r--cpan/version/t/08_corelist.t2
-rw-r--r--cpan/version/t/09_list_util.t2
-rw-r--r--vutil.c5
13 files changed, 78 insertions, 76 deletions
diff --git a/cpan/version/lib/version.pm b/cpan/version/lib/version.pm
index 280c8595f4..b337a90a86 100644
--- a/cpan/version/lib/version.pm
+++ b/cpan/version/lib/version.pm
@@ -6,7 +6,7 @@ use strict;
use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
-$VERSION = 0.9907;
+$VERSION = 0.9908;
$CLASS = 'version';
# avoid using Exporter
diff --git a/cpan/version/lib/version/regex.pm b/cpan/version/lib/version/regex.pm
index 1c8f6e1849..f92c78be2f 100644
--- a/cpan/version/lib/version/regex.pm
+++ b/cpan/version/lib/version/regex.pm
@@ -4,7 +4,7 @@ use strict;
use vars qw($VERSION $CLASS $STRICT $LAX);
-$VERSION = 0.9907;
+$VERSION = 0.9908;
#--------------------------------------------------------------------------#
# Version regexp components
diff --git a/cpan/version/lib/version/vpp.pm b/cpan/version/lib/version/vpp.pm
index 3ef1170b5d..3ac3f1361f 100644
--- a/cpan/version/lib/version/vpp.pm
+++ b/cpan/version/lib/version/vpp.pm
@@ -122,7 +122,7 @@ use strict;
use Config;
use vars qw($VERSION $CLASS @ISA $LAX $STRICT);
-$VERSION = 0.9907;
+$VERSION = 0.9908;
$CLASS = 'version::vpp';
require version::regex;
@@ -634,78 +634,78 @@ sub scan_version {
return $s;
}
-sub new
-{
- my ($class, $value) = @_;
- unless (defined $class) {
- require Carp;
- Carp::croak('Usage: version::new(class, version)');
- }
- my $self = bless ({}, ref ($class) || $class);
- my $qv = FALSE;
-
- if ( ref($value) && eval('$value->isa("version")') ) {
- # Can copy the elements directly
- $self->{version} = [ @{$value->{version} } ];
- $self->{qv} = 1 if $value->{qv};
- $self->{alpha} = 1 if $value->{alpha};
- $self->{original} = ''.$value->{original};
- return $self;
- }
+sub new {
+ my $class = shift;
+ unless (defined $class or $#_ > 1) {
+ require Carp;
+ Carp::croak('Usage: version::new(class, version)');
+ }
- if ( not defined $value or $value =~ /^undef$/ ) {
- # RT #19517 - special case for undef comparison
- # or someone forgot to pass a value
- push @{$self->{version}}, 0;
- $self->{original} = "0";
- return ($self);
- }
+ my $self = bless ({}, ref ($class) || $class);
+ my $qv = FALSE;
- if ( $#_ == 2 ) { # must be CVS-style
- $value = $_[2];
- $qv = TRUE;
- }
+ if ( $#_ == 1 ) { # must be CVS-style
+ $qv = TRUE;
+ }
+ my $value = pop; # always going to be the last element
- if (ref($value) =~ m/ARRAY|HASH/) {
- require Carp;
- Carp::croak("Invalid version format (non-numeric data)");
- }
+ if ( ref($value) && eval('$value->isa("version")') ) {
+ # Can copy the elements directly
+ $self->{version} = [ @{$value->{version} } ];
+ $self->{qv} = 1 if $value->{qv};
+ $self->{alpha} = 1 if $value->{alpha};
+ $self->{original} = ''.$value->{original};
+ return $self;
+ }
+
+ if ( not defined $value or $value =~ /^undef$/ ) {
+ # RT #19517 - special case for undef comparison
+ # or someone forgot to pass a value
+ push @{$self->{version}}, 0;
+ $self->{original} = "0";
+ return ($self);
+ }
- $value = _un_vstring($value);
- if ($Config{d_setlocale}) {
- use POSIX qw/locale_h/;
- use if $Config{d_setlocale}, 'locale';
- my $currlocale = setlocale(LC_ALL);
+ if (ref($value) =~ m/ARRAY|HASH/) {
+ require Carp;
+ Carp::croak("Invalid version format (non-numeric data)");
+ }
- # if the current locale uses commas for decimal points, we
- # just replace commas with decimal places, rather than changing
- # locales
- if ( localeconv()->{decimal_point} eq ',' ) {
- $value =~ tr/,/./;
- }
- }
+ $value = _un_vstring($value);
- # exponential notation
- if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
- $value = sprintf("%.9f",$value);
- $value =~ s/(0+)$//; # trim trailing zeros
+ if ($Config{d_setlocale}) {
+ use POSIX qw/locale_h/;
+ use if $Config{d_setlocale}, 'locale';
+ my $currlocale = setlocale(LC_ALL);
+
+ # if the current locale uses commas for decimal points, we
+ # just replace commas with decimal places, rather than changing
+ # locales
+ if ( localeconv()->{decimal_point} eq ',' ) {
+ $value =~ tr/,/./;
}
+ }
- my $s = scan_version($value, \$self, $qv);
+ # exponential notation
+ if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
+ $value = sprintf("%.9f",$value);
+ $value =~ s/(0+)$//; # trim trailing zeros
+ }
- if ($s) { # must be something left over
- warn("Version string '%s' contains invalid data; "
- ."ignoring: '%s'", $value, $s);
- }
+ my $s = scan_version($value, \$self, $qv);
- return ($self);
+ if ($s) { # must be something left over
+ warn("Version string '%s' contains invalid data; "
+ ."ignoring: '%s'", $value, $s);
+ }
+
+ return ($self);
}
*parse = \&new;
-sub numify
-{
+sub numify {
my ($self) = @_;
unless (_verify($self)) {
require Carp;
@@ -745,8 +745,7 @@ sub numify
return $string;
}
-sub normal
-{
+sub normal {
my ($self) = @_;
unless (_verify($self)) {
require Carp;
@@ -781,8 +780,7 @@ sub normal
return $string;
}
-sub stringify
-{
+sub stringify {
my ($self) = @_;
unless (_verify($self)) {
require Carp;
@@ -795,8 +793,7 @@ sub stringify
: $self->numify;
}
-sub vcmp
-{
+sub vcmp {
require UNIVERSAL;
my ($left,$right,$swap) = @_;
my $class = ref($left);
diff --git a/cpan/version/t/00impl-pp.t b/cpan/version/t/00impl-pp.t
index 836a75aa5f..ba540c942c 100644
--- a/cpan/version/t/00impl-pp.t
+++ b/cpan/version/t/00impl-pp.t
@@ -9,7 +9,7 @@ use Test::More qw/no_plan/;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
require $coretests;
- use_ok('version::vpp', 0.9907);
+ use_ok('version::vpp', 0.9908);
}
BaseTests("version::vpp","new","qv");
diff --git a/cpan/version/t/01base.t b/cpan/version/t/01base.t
index 3c7edcf5c7..b452e3bf2e 100644
--- a/cpan/version/t/01base.t
+++ b/cpan/version/t/01base.t
@@ -9,7 +9,7 @@ use Test::More qw/no_plan/;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
require $coretests;
- use_ok('version', 0.9907);
+ use_ok('version', 0.9908);
}
BaseTests("version","new","qv");
diff --git a/cpan/version/t/02derived.t b/cpan/version/t/02derived.t
index 5bd443758b..ee9e674ff5 100644
--- a/cpan/version/t/02derived.t
+++ b/cpan/version/t/02derived.t
@@ -10,7 +10,7 @@ use File::Temp qw/tempfile/;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
require $coretests;
- use_ok("version", 0.9907);
+ use_ok("version", 0.9908);
# If we made it this far, we are ok.
}
diff --git a/cpan/version/t/03require.t b/cpan/version/t/03require.t
index 48ddcd6d8a..c394728098 100644
--- a/cpan/version/t/03require.t
+++ b/cpan/version/t/03require.t
@@ -14,7 +14,7 @@ BEGIN {
# Don't want to use, because we need to make sure that the import doesn't
# fire just yet (some code does this to avoid importing qv() and delare()).
require_ok("version");
-is $version::VERSION, 0.9907, "Make sure we have the correct class";
+is $version::VERSION, 0.9908, "Make sure we have the correct class";
ok(!"main"->can("qv"), "We don't have the imported qv()");
ok(!"main"->can("declare"), "We don't have the imported declare()");
diff --git a/cpan/version/t/05sigdie.t b/cpan/version/t/05sigdie.t
index a145450472..8b5b375b3c 100644
--- a/cpan/version/t/05sigdie.t
+++ b/cpan/version/t/05sigdie.t
@@ -14,7 +14,7 @@ BEGIN {
}
BEGIN {
- use version 0.9907;
+ use version 0.9908;
}
pass "Didn't get caught by the wrong DIE handler, which is a good thing";
diff --git a/cpan/version/t/06noop.t b/cpan/version/t/06noop.t
index 97c7e6546e..66baef4b52 100644
--- a/cpan/version/t/06noop.t
+++ b/cpan/version/t/06noop.t
@@ -7,7 +7,7 @@
use Test::More qw/no_plan/;
BEGIN {
- use_ok('version', 0.9907);
+ use_ok('version', 0.9908);
}
my $v1 = version->new('1.2');
diff --git a/cpan/version/t/07locale.t b/cpan/version/t/07locale.t
index de6588c072..d852aeca8b 100644
--- a/cpan/version/t/07locale.t
+++ b/cpan/version/t/07locale.t
@@ -11,7 +11,7 @@ use Test::More tests => 7;
use Config;
BEGIN {
- use_ok('version', 0.9907);
+ use_ok('version', 0.9908);
}
SKIP: {
@@ -31,7 +31,7 @@ SKIP: {
# because have to
# evaluate in current
# scope
- use locale;
+ use if $^O !~ /android/, 'locale';
while (<DATA>) {
chomp;
diff --git a/cpan/version/t/08_corelist.t b/cpan/version/t/08_corelist.t
index 48c61c3e6c..310c9cd42a 100644
--- a/cpan/version/t/08_corelist.t
+++ b/cpan/version/t/08_corelist.t
@@ -5,7 +5,7 @@
#########################
use Test::More tests => 3;
-use_ok("version", 0.9907);
+use_ok("version", 0.9908);
# do strict lax tests in a sub to isolate a package to test importing
SKIP: {
diff --git a/cpan/version/t/09_list_util.t b/cpan/version/t/09_list_util.t
index 110c1a035d..d0e3fa951b 100644
--- a/cpan/version/t/09_list_util.t
+++ b/cpan/version/t/09_list_util.t
@@ -4,7 +4,7 @@
#########################
use strict;
-use_ok("version", 0.9907);
+use_ok("version", 0.9908);
use Test::More;
BEGIN {
diff --git a/vutil.c b/vutil.c
index 96aa6f63ad..4cf0173548 100644
--- a/vutil.c
+++ b/vutil.c
@@ -553,7 +553,9 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
const MAGIC *mg;
#endif
+#if PERL_VERSION_LT(5,19,8) && defined(USE_ITHREADS)
ENTER;
+#endif
PERL_ARGS_ASSERT_UPG_VERSION;
if ( SvNOK(ver) && !( SvPOK(ver) && SvCUR(ver) == 3 ) )
@@ -656,7 +658,10 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
Perl_ck_warner(aTHX_ packWARN(WARN_MISC),
"Version string '%s' contains invalid data; "
"ignoring: '%s'", version, s);
+
+#if PERL_VERSION_LT(5,19,8) && defined(USE_ITHREADS)
LEAVE;
+#endif
return ver;
}