line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::MirrorMerger::PackageInfo; |
2
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
56
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
896
|
use version; |
|
2
|
|
|
|
|
3862
|
|
|
2
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
187
|
use Class::Accessor::Lite ro => [qw/mirror module path/], new => 1; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
13
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $ZERO_VERSION = version->declare('0.000_000'); |
10
|
|
|
|
|
|
|
|
11
|
8
|
|
|
8
|
0
|
4342
|
sub version :method { shift->{version} } ## XXX: avoid name conflict |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub compareble_version { |
14
|
2
|
|
|
2
|
0
|
6
|
my $self = shift; |
15
|
2
|
50
|
|
|
|
6
|
return $ZERO_VERSION if $self->version eq 'undef'; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
3
|
my $compareble_version = eval { ::version->parse($self->version) }; |
|
2
|
|
|
|
|
6
|
|
18
|
2
|
|
33
|
|
|
36
|
return $self->{compareble_version} //= $compareble_version // $ZERO_VERSION; |
|
|
|
33
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub canonicalized_path { |
22
|
12
|
|
|
12
|
0
|
21
|
my $self = shift; |
23
|
12
|
100
|
|
|
|
47
|
return $self->{canonicalized_path} if exists $self->{canonicalized_path}; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
8
|
my $path = $self->path; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# XXX: fix backpan's path |
28
|
3
|
50
|
|
|
|
33
|
if ($path !~ m![A-Z0-9]/[A-Z0-9]{2}/!) { |
29
|
0
|
|
|
|
|
0
|
my $p2 = substr $path, 0, 2; |
30
|
0
|
|
|
|
|
0
|
my $p1 = substr $p2, 0, 1; |
31
|
0
|
|
|
|
|
0
|
$path = "$p1/$p2/$path"; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
|
|
17
|
return $self->{canonicalized_path} = $path; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |