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