line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!perl -w |
2
|
|
|
|
|
|
|
package version; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
678298
|
use 5.006002; |
|
11
|
|
|
|
|
145
|
|
5
|
11
|
|
|
11
|
|
59
|
use strict; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
294
|
|
6
|
11
|
|
|
11
|
|
61
|
use warnings::register; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
3863
|
|
7
|
|
|
|
|
|
|
if ($] >= 5.015) { |
8
|
|
|
|
|
|
|
warnings::register_categories(qw/version/); |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = 0.9928; |
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
|
|
4455
|
eval "use version::vxs $VERSION"; |
|
11
|
|
|
|
|
199
|
|
|
11
|
|
|
|
|
201
|
|
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
|
|
128
|
no strict 'refs'; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
2088
|
|
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
|
|
97
|
no strict 'refs'; |
|
11
|
|
|
|
|
62
|
|
|
11
|
|
|
|
|
2169
|
|
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
|
|
76
|
no strict 'refs'; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
4835
|
|
74
|
34
|
|
|
34
|
|
97048
|
my ($class) = shift; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Set up any derived class |
77
|
34
|
100
|
|
|
|
129
|
unless ($class eq $CLASS) { |
78
|
16
|
|
|
|
|
78
|
local $^W; |
79
|
16
|
|
|
|
|
27
|
*{$class.'::declare'} = \&{$CLASS.'::declare'}; |
|
16
|
|
|
|
|
76
|
|
|
16
|
|
|
|
|
70
|
|
80
|
16
|
|
|
|
|
29
|
*{$class.'::qv'} = \&{$CLASS.'::qv'}; |
|
16
|
|
|
|
|
58
|
|
|
16
|
|
|
|
|
48
|
|
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
34
|
|
|
|
|
68
|
my %args; |
84
|
34
|
100
|
|
|
|
102
|
if (@_) { # any remaining terms are arguments |
85
|
11
|
|
|
|
|
26
|
map { $args{$_} = 1 } @_ |
|
22
|
|
|
|
|
67
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { # no parameters at all on use line |
88
|
23
|
|
|
|
|
91
|
%args = |
89
|
|
|
|
|
|
|
( |
90
|
|
|
|
|
|
|
qv => 1, |
91
|
|
|
|
|
|
|
'UNIVERSAL::VERSION' => 1, |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
34
|
|
|
|
|
85
|
my $callpkg = caller(); |
96
|
|
|
|
|
|
|
|
97
|
34
|
100
|
|
|
|
117
|
if (exists($args{declare})) { |
98
|
9
|
|
|
|
|
27
|
*{$callpkg.'::declare'} = |
99
|
8
|
|
|
8
|
|
9622
|
sub {return $class->declare(shift) } |
100
|
10
|
100
|
|
|
|
17
|
unless defined(&{$callpkg.'::declare'}); |
|
10
|
|
|
|
|
81
|
|
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
34
|
100
|
|
|
|
96
|
if (exists($args{qv})) { |
104
|
27
|
|
|
|
|
103
|
*{$callpkg.'::qv'} = |
105
|
8
|
|
|
8
|
|
9587
|
sub {return $class->qv(shift) } |
106
|
31
|
100
|
|
|
|
59
|
unless defined(&{$callpkg.'::qv'}); |
|
31
|
|
|
|
|
229
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
34
|
100
|
|
|
|
102
|
if (exists($args{'UNIVERSAL::VERSION'})) { |
110
|
23
|
|
|
|
|
87
|
local $^W; |
111
|
|
|
|
|
|
|
*UNIVERSAL::VERSION |
112
|
23
|
|
|
|
|
44
|
= \&{$CLASS.'::_VERSION'}; |
|
23
|
|
|
|
|
100
|
|
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
34
|
50
|
|
|
|
100
|
if (exists($args{'VERSION'})) { |
116
|
0
|
|
|
|
|
0
|
*{$callpkg.'::VERSION'} = \&{$CLASS.'::_VERSION'}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
34
|
100
|
|
|
|
100
|
if (exists($args{'is_strict'})) { |
120
|
1
|
|
|
|
|
3
|
*{$callpkg.'::is_strict'} = \&{$CLASS.'::is_strict'} |
|
1
|
|
|
|
|
3
|
|
121
|
1
|
50
|
|
|
|
1
|
unless defined(&{$callpkg.'::is_strict'}); |
|
1
|
|
|
|
|
5
|
|
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
34
|
100
|
|
|
|
41623
|
if (exists($args{'is_lax'})) { |
125
|
1
|
|
|
|
|
4
|
*{$callpkg.'::is_lax'} = \&{$CLASS.'::is_lax'} |
|
1
|
|
|
|
|
2
|
|
126
|
1
|
50
|
|
|
|
2
|
unless defined(&{$callpkg.'::is_lax'}); |
|
1
|
|
|
|
|
4
|
|
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |