line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!perl -w |
2
|
|
|
|
|
|
|
package version; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
715948
|
use 5.006002; |
|
11
|
|
|
|
|
151
|
|
5
|
11
|
|
|
11
|
|
58
|
use strict; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
296
|
|
6
|
11
|
|
|
11
|
|
58
|
use warnings::register; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
3977
|
|
7
|
|
|
|
|
|
|
if ($] >= 5.015) { |
8
|
|
|
|
|
|
|
warnings::register_categories(qw/version/); |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = 0.9929; |
12
|
|
|
|
|
|
|
our $CLASS = 'version'; |
13
|
|
|
|
|
|
|
our (@ISA, $STRICT, $LAX); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# !!!!Delete this next block completely when adding to Perl core!!!! |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
local $SIG{'__DIE__'}; |
18
|
11
|
|
|
11
|
|
5039
|
eval "use version::vxs $VERSION"; |
|
11
|
|
|
|
|
201
|
|
|
11
|
|
|
|
|
195
|
|
19
|
|
|
|
|
|
|
if ( $@ ) { # don't have the XS version installed |
20
|
|
|
|
|
|
|
eval "use version::vpp $VERSION"; # don't tempt fate |
21
|
|
|
|
|
|
|
die "$@" if ( $@ ); |
22
|
|
|
|
|
|
|
push @ISA, "version::vpp"; |
23
|
|
|
|
|
|
|
local $^W; |
24
|
|
|
|
|
|
|
*version::qv = \&version::vpp::qv; |
25
|
|
|
|
|
|
|
*version::declare = \&version::vpp::declare; |
26
|
|
|
|
|
|
|
*version::_VERSION = \&version::vpp::_VERSION; |
27
|
|
|
|
|
|
|
*version::vcmp = \&version::vpp::vcmp; |
28
|
|
|
|
|
|
|
*version::new = \&version::vpp::new; |
29
|
|
|
|
|
|
|
*version::numify = \&version::vpp::numify; |
30
|
|
|
|
|
|
|
*version::normal = \&version::vpp::normal; |
31
|
|
|
|
|
|
|
if ($] >= 5.009000) { |
32
|
11
|
|
|
11
|
|
96
|
no strict 'refs'; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
2066
|
|
33
|
|
|
|
|
|
|
*version::stringify = \&version::vpp::stringify; |
34
|
|
|
|
|
|
|
*{'version::(""'} = \&version::vpp::stringify; |
35
|
|
|
|
|
|
|
*{'version::(<=>'} = \&version::vpp::vcmp; |
36
|
|
|
|
|
|
|
*{'version::(cmp'} = \&version::vpp::vcmp; |
37
|
|
|
|
|
|
|
*version::parse = \&version::vpp::parse; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
else { # use XS module |
41
|
|
|
|
|
|
|
push @ISA, "version::vxs"; |
42
|
|
|
|
|
|
|
local $^W; |
43
|
|
|
|
|
|
|
*version::declare = \&version::vxs::declare; |
44
|
|
|
|
|
|
|
*version::qv = \&version::vxs::qv; |
45
|
|
|
|
|
|
|
*version::_VERSION = \&version::vxs::_VERSION; |
46
|
|
|
|
|
|
|
*version::vcmp = \&version::vxs::VCMP; |
47
|
|
|
|
|
|
|
*version::new = \&version::vxs::new; |
48
|
|
|
|
|
|
|
*version::numify = \&version::vxs::numify; |
49
|
|
|
|
|
|
|
*version::normal = \&version::vxs::normal; |
50
|
|
|
|
|
|
|
if ($] >= 5.009000) { |
51
|
11
|
|
|
11
|
|
78
|
no strict 'refs'; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
2227
|
|
52
|
|
|
|
|
|
|
*version::stringify = \&version::vxs::stringify; |
53
|
|
|
|
|
|
|
*{'version::(""'} = \&version::vxs::stringify; |
54
|
|
|
|
|
|
|
*{'version::(<=>'} = \&version::vxs::VCMP; |
55
|
|
|
|
|
|
|
*{'version::(cmp'} = \&version::vxs::VCMP; |
56
|
|
|
|
|
|
|
*version::parse = \&version::vxs::parse; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# avoid using Exporter |
62
|
|
|
|
|
|
|
require version::regex; |
63
|
|
|
|
|
|
|
*version::is_lax = \&version::regex::is_lax; |
64
|
|
|
|
|
|
|
*version::is_strict = \&version::regex::is_strict; |
65
|
|
|
|
|
|
|
*LAX = \$version::regex::LAX; |
66
|
|
|
|
|
|
|
*LAX_DECIMAL_VERSION = \$version::regex::LAX_DECIMAL_VERSION; |
67
|
|
|
|
|
|
|
*LAX_DOTTED_DECIMAL_VERSION = \$version::regex::LAX_DOTTED_DECIMAL_VERSION; |
68
|
|
|
|
|
|
|
*STRICT = \$version::regex::STRICT; |
69
|
|
|
|
|
|
|
*STRICT_DECIMAL_VERSION = \$version::regex::STRICT_DECIMAL_VERSION; |
70
|
|
|
|
|
|
|
*STRICT_DOTTED_DECIMAL_VERSION = \$version::regex::STRICT_DOTTED_DECIMAL_VERSION; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub import { |
73
|
11
|
|
|
11
|
|
93
|
no strict 'refs'; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
4852
|
|
74
|
34
|
|
|
34
|
|
100356
|
my ($class) = shift; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Set up any derived class |
77
|
34
|
100
|
|
|
|
162
|
unless ($class eq $CLASS) { |
78
|
16
|
|
|
|
|
88
|
local $^W; |
79
|
16
|
|
|
|
|
40
|
*{$class.'::declare'} = \&{$CLASS.'::declare'}; |
|
16
|
|
|
|
|
92
|
|
|
16
|
|
|
|
|
89
|
|
80
|
16
|
|
|
|
|
49
|
*{$class.'::qv'} = \&{$CLASS.'::qv'}; |
|
16
|
|
|
|
|
76
|
|
|
16
|
|
|
|
|
53
|
|
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
34
|
|
|
|
|
74
|
my %args; |
84
|
34
|
100
|
|
|
|
129
|
if (@_) { # any remaining terms are arguments |
85
|
11
|
|
|
|
|
32
|
map { $args{$_} = 1 } @_ |
|
22
|
|
|
|
|
85
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { # no parameters at all on use line |
88
|
23
|
|
|
|
|
102
|
%args = |
89
|
|
|
|
|
|
|
( |
90
|
|
|
|
|
|
|
qv => 1, |
91
|
|
|
|
|
|
|
'UNIVERSAL::VERSION' => 1, |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
34
|
|
|
|
|
99
|
my $callpkg = caller(); |
96
|
|
|
|
|
|
|
|
97
|
34
|
100
|
|
|
|
128
|
if (exists($args{declare})) { |
98
|
9
|
|
|
|
|
31
|
*{$callpkg.'::declare'} = |
99
|
8
|
|
|
8
|
|
10119
|
sub {return $class->declare(shift) } |
100
|
10
|
100
|
|
|
|
16
|
unless defined(&{$callpkg.'::declare'}); |
|
10
|
|
|
|
|
87
|
|
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
34
|
100
|
|
|
|
157
|
if (exists($args{qv})) { |
104
|
27
|
|
|
|
|
115
|
*{$callpkg.'::qv'} = |
105
|
8
|
|
|
8
|
|
9932
|
sub {return $class->qv(shift) } |
106
|
31
|
100
|
|
|
|
50
|
unless defined(&{$callpkg.'::qv'}); |
|
31
|
|
|
|
|
271
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
34
|
100
|
|
|
|
116
|
if (exists($args{'UNIVERSAL::VERSION'})) { |
110
|
23
|
|
|
|
|
96
|
local $^W; |
111
|
|
|
|
|
|
|
*UNIVERSAL::VERSION |
112
|
23
|
|
|
|
|
47
|
= \&{$CLASS.'::_VERSION'}; |
|
23
|
|
|
|
|
114
|
|
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
34
|
50
|
|
|
|
121
|
if (exists($args{'VERSION'})) { |
116
|
0
|
|
|
|
|
0
|
*{$callpkg.'::VERSION'} = \&{$CLASS.'::_VERSION'}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
34
|
100
|
|
|
|
127
|
if (exists($args{'is_strict'})) { |
120
|
1
|
|
|
|
|
3
|
*{$callpkg.'::is_strict'} = \&{$CLASS.'::is_strict'} |
|
1
|
|
|
|
|
3
|
|
121
|
1
|
50
|
|
|
|
2
|
unless defined(&{$callpkg.'::is_strict'}); |
|
1
|
|
|
|
|
4
|
|
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
34
|
100
|
|
|
|
41548
|
if (exists($args{'is_lax'})) { |
125
|
1
|
|
|
|
|
4
|
*{$callpkg.'::is_lax'} = \&{$CLASS.'::is_lax'} |
|
1
|
|
|
|
|
3
|
|
126
|
1
|
50
|
|
|
|
1
|
unless defined(&{$callpkg.'::is_lax'}); |
|
1
|
|
|
|
|
3
|
|
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |