line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::MirrorMerger::PackageInfo; |
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
45
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
725
|
use version; |
|
2
|
|
|
|
|
3160
|
|
|
2
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
141
|
use Class::Accessor::Lite ro => [qw/mirror module path/], new => 1; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
12
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $ZERO_VERSION = version->declare('0.000_000'); |
10
|
|
|
|
|
|
|
|
11
|
8
|
|
|
8
|
0
|
3621
|
sub version :method { shift->{version} } ## XXX: avoid name conflict |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub compareble_version { |
14
|
2
|
|
|
2
|
0
|
4
|
my $self = shift; |
15
|
2
|
50
|
|
|
|
6
|
return $ZERO_VERSION if $self->version eq 'undef'; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
4
|
my $compareble_version = eval { ::version->parse($self->version) }; |
|
2
|
|
|
|
|
3
|
|
18
|
2
|
|
33
|
|
|
29
|
return $self->{compareble_version} //= $compareble_version // $ZERO_VERSION; |
|
|
|
33
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub canonicalized_path { |
22
|
12
|
|
|
12
|
0
|
18
|
my $self = shift; |
23
|
12
|
100
|
|
|
|
36
|
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
|
|
|
|
25
|
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
|
|
|
|
|
13
|
return $self->{canonicalized_path} = $path; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |