Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 344bea6

Browse files
committed
version-0.9924_02
use vars => our. Add updates from 0.9918: Add LAX_DECIMAL_VERSION, LAX_DOTTED_DECIMAL_VERSION, STRICT_DECIMAL_VERSION, STRICT_DOTTED_DECIMAL_VERSION regexes. Add updates from 0.9921: pod, safer C locale switching. Add vpp support for cperl: scmp, c suffix. More test fixes for 5.6
1 parent b99d9ed commit 344bea6

File tree

18 files changed

+203
-102
lines changed

18 files changed

+203
-102
lines changed

Porting/Maintainers.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,8 @@ package Maintainers;
15641564
},
15651565

15661566
'version' => {
1567-
'DISTRIBUTION' => 'JPEACOCK/version-0.9918.tar.gz',
1567+
# https://github.com/rurban/version/commits/cperl
1568+
'DISTRIBUTION' => 'RURBAN/version-0.9924_02.tar.gz',
15681569
'FILES' => q[cpan/version vutil.c vutil.h vxs.inc],
15691570
'EXCLUDED' => [
15701571
qr{^vutil/lib/},

cpan/version/lib/version.pm

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ package version;
33

44
use 5.006002;
55
use strict;
6+
use warnings::register;
7+
if ($] >= 5.015) {
8+
warnings::register_categories(qw/version/);
9+
}
610

7-
use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
8-
9-
$VERSION = '0.9918_02c';
10-
$VERSION =~ s/c$//;
11-
$CLASS = 'version';
11+
our $VERSION = '0.9924_02';
12+
our $XS_VERSION = $VERSION;
13+
#$VERSION =~ s/c$//;
14+
$VERSION = eval $VERSION;
15+
our $CLASS = 'version';
16+
our (@ISA, $STRICT, $LAX);
1217

1318
# avoid using Exporter
1419
require version::regex;

cpan/version/lib/version.pod

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ version - Perl extension for Version Objects
1212
# Declaring a dotted-decimal $VERSION (keep on one line!)
1313

1414
use version; our $VERSION = version->declare("v1.2.3"); # formal
15-
use version; our $VERSION = qv("v1.2.3"); # shorthand
16-
use version; our $VERSION = qv("v1.2_3"); # alpha
15+
use version; our $VERSION = qv("v1.2.3"); # deprecated
16+
use version; our $VERSION = qv("v1.2_3"); # deprecated
1717

1818
# Declaring an old-style decimal $VERSION (use quotes!)
1919

@@ -269,11 +269,10 @@ leading-v and at least 3 components.
269269

270270
=head2 numify()
271271

272-
Returns a value representing the object in a pure decimal form without
273-
trailing zeroes.
272+
Returns a value representing the object in a pure decimal.
274273

275-
version->declare('v1.2')->numify; # 1.002
276-
version->parse('1.2')->numify; # 1.2
274+
version->declare('v1.2')->numify; # 1.002000
275+
version->parse('1.2')->numify; # 1.200
277276

278277
=head2 stringify()
279278

@@ -283,7 +282,7 @@ way perl would normally represent it in a string. This method is used whenever
283282
a version object is interpolated into a string.
284283

285284
version->declare('v1.2')->stringify; # v1.2
286-
version->parse('1.200')->stringify; # 1.200
285+
version->parse('1.200')->stringify; # 1.2
287286
version->parse(1.02_30)->stringify; # 1.023
288287

289288
=head1 EXPORTED FUNCTIONS

cpan/version/lib/version/regex.pm

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@ package version::regex;
22

33
use strict;
44

5-
use vars qw(
6-
$VERSION $CLASS $STRICT $LAX
7-
$STRICT_DECIMAL_VERSION $STRICT_DOTTED_DECIMAL_VERSION
8-
$LAX_DECIMAL_VERSION $LAX_DOTTED_DECIMAL_VERSION
9-
);
10-
11-
$VERSION = '0.9918_02c';
12-
$VERSION =~ s/c$//;
5+
our $VERSION = '0.9924_02';
136

147
#--------------------------------------------------------------------------#
158
# Version regexp components
@@ -63,19 +56,19 @@ my $LAX_ALPHA_PART = qr/(?:_[0-9]+c?|c?)/;
6356

6457
# Strict decimal version number.
6558

66-
$STRICT_DECIMAL_VERSION =
59+
our $STRICT_DECIMAL_VERSION =
6760
qr/ $STRICT_INTEGER_PART $FRACTION_PART? c? /x;
6861

6962
# Strict dotted-decimal version number. Must have both leading "v" and
7063
# at least three parts, to avoid confusion with decimal syntax.
7164

72-
$STRICT_DOTTED_DECIMAL_VERSION =
65+
our $STRICT_DOTTED_DECIMAL_VERSION =
7366
qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} c? /x;
7467

7568
# Complete strict version number syntax -- should generally be used
7669
# anchored: qr/ \A $STRICT \z /x
7770

78-
$STRICT =
71+
our $STRICT =
7972
qr/ $STRICT_DECIMAL_VERSION | $STRICT_DOTTED_DECIMAL_VERSION /x;
8073

8174
#--------------------------------------------------------------------------#
@@ -86,7 +79,7 @@ $STRICT =
8679
# allowing an alpha suffix or allowing a leading or trailing
8780
# decimal-point
8881

89-
$LAX_DECIMAL_VERSION =
82+
our $LAX_DECIMAL_VERSION =
9083
qr/ $LAX_INTEGER_PART (?: $FRACTION_PART | \. )? $LAX_ALPHA_PART?
9184
|
9285
$FRACTION_PART $LAX_ALPHA_PART?
@@ -98,7 +91,7 @@ $LAX_DECIMAL_VERSION =
9891
# enough, without the leading "v", Perl takes .1.2 to mean v0.1.2,
9992
# so when there is no "v", the leading part is optional
10093

101-
$LAX_DOTTED_DECIMAL_VERSION =
94+
our $LAX_DOTTED_DECIMAL_VERSION =
10295
qr/
10396
v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )?
10497
|
@@ -111,7 +104,7 @@ $LAX_DOTTED_DECIMAL_VERSION =
111104
# The string 'undef' is a special case to make for easier handling
112105
# of return values from ExtUtils::MM->parse_version
113106

114-
$LAX =
107+
our $LAX =
115108
qr/ undef | $LAX_DOTTED_DECIMAL_VERSION | $LAX_DECIMAL_VERSION /x;
116109

117110
#--------------------------------------------------------------------------#

cpan/version/t/01base.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BEGIN {
1414
)
1515
);
1616
require $coretests;
17-
use_ok('version', 0.9918);
17+
use_ok('version', 0.992402);
1818
}
1919

2020
BaseTests("version","new","qv");

cpan/version/t/02derived.t

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BEGIN {
1515
)
1616
);
1717
require $coretests;
18-
use_ok("version", 0.9918);
18+
use_ok("version", 0.992402);
1919
# If we made it this far, we are ok.
2020
}
2121

@@ -51,8 +51,7 @@ print $fh <<"EOF";
5151
# This is an empty subclass
5252
package $package;
5353
use parent 'version';
54-
use vars '\$VERSION';
55-
\$VERSION=0.001;
54+
our \$VERSION = 0.001;
5655
EOF
5756
close $fh;
5857

cpan/version/t/03require.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BEGIN {
1919
# Don't want to use, because we need to make sure that the import doesn't
2020
# fire just yet (some code does this to avoid importing qv() and delare()).
2121
require_ok("version");
22-
is $version::VERSION, '0.9918_02', "Make sure we have the correct class";
22+
is $version::VERSION, 0.992402, "Make sure we have the correct class";
2323
ok(!"main"->can("qv"), "We don't have the imported qv()");
2424
ok(!"main"->can("declare"), "We don't have the imported declare()");
2525

cpan/version/t/05sigdie.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BEGIN {
1414
}
1515

1616
BEGIN {
17-
use version 0.9918;
17+
use version 0.992402;
1818
}
1919

2020
pass "Didn't get caught by the wrong DIE handler, which is a good thing";

cpan/version/t/06noop.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Test::More qw/no_plan/;
88

99
BEGIN {
10-
use_ok('version', 0.9918);
10+
use_ok('version', 0.992402);
1111
}
1212

1313
my $v1 = version->new('1.2');

cpan/version/t/07locale.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Test::More tests => 8;
1111
use Config;
1212

1313
BEGIN {
14-
use_ok('version', 0.9918);
14+
use_ok('version', 0.992402);
1515
}
1616

1717
SKIP: {

0 commit comments

Comments
 (0)