line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Flatten::Distribution; |
2
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
18
|
|
4
|
1
|
|
|
1
|
|
2091
|
use Module::CoreList; |
|
1
|
|
|
|
|
30449
|
|
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
486
|
use CPAN::Flatten::Distribution::Emitter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
396
|
use parent 'CPAN::Flatten::Tree'; |
|
1
|
|
|
|
|
212
|
|
|
1
|
|
|
|
|
4
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_dummy { |
10
|
0
|
|
|
0
|
0
|
|
shift->{dummy}; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub dummy { |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my $class = ref $self; |
16
|
0
|
|
|
|
|
|
$class->new(distfile => $self->distfile, dummy => 1); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub provides { |
20
|
0
|
0
|
|
0
|
0
|
|
shift->{provides} || []; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub requirements { |
24
|
0
|
0
|
|
0
|
0
|
|
shift->{requirements} || []; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub distfile { |
28
|
0
|
|
|
0
|
0
|
|
shift->{distfile}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub name { |
32
|
0
|
0
|
|
0
|
0
|
|
my $distfile = shift->distfile or return; |
33
|
0
|
|
|
|
|
|
$distfile =~ s{^./../}{}; |
34
|
0
|
|
|
|
|
|
$distfile =~ s{\.(?:tar\.gz|zip|tgz|tar\.bz2)$}{}; |
35
|
0
|
|
|
|
|
|
$distfile; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
|
165
|
use constant STOP => -1; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
200
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub providing { |
41
|
0
|
|
|
0
|
0
|
|
my ($self, $package, $version) = @_; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $providing; |
44
|
|
|
|
|
|
|
$self->walk_down(sub { |
45
|
0
|
|
|
0
|
|
|
my ($node, $depth) = @_; |
46
|
0
|
|
|
|
|
|
$providing = $node->_providing_by_myself($package, $version); |
47
|
0
|
0
|
|
|
|
|
return STOP if $providing; |
48
|
0
|
|
|
|
|
|
}); |
49
|
0
|
|
|
|
|
|
return $providing; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _providing_by_myself { |
53
|
0
|
|
|
0
|
|
|
my ($self, $package, $version) = @_; |
54
|
0
|
|
|
|
|
|
for my $provide (@{$self->provides}) { |
|
0
|
|
|
|
|
|
|
55
|
0
|
0
|
|
|
|
|
return $self if $provide->{package} eq $package; |
56
|
|
|
|
|
|
|
} |
57
|
0
|
|
|
|
|
|
return; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub emit { |
61
|
0
|
|
|
0
|
0
|
|
my ($self, $fh) = @_; |
62
|
0
|
|
|
|
|
|
CPAN::Flatten::Distribution::Emitter->emit($self, $fh); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub equals { |
66
|
0
|
|
|
0
|
0
|
|
my ($self, $that) = @_; |
67
|
0
|
0
|
0
|
|
|
|
$self->distfile && $that->distfile and $self->distfile eq $that->distfile; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |