line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Packager::DependencyFilter::Role; |
2
|
2
|
|
|
2
|
|
3320
|
use Mouse::Role; |
|
2
|
|
|
|
|
2319
|
|
|
2
|
|
|
|
|
10
|
|
3
|
2
|
|
|
2
|
|
6336
|
use List::Compare; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
928
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub filter_dependencies { |
6
|
0
|
|
|
0
|
0
|
|
my ( $self, $module, $depends, $dependency_config ) = @_; |
7
|
0
|
|
|
|
|
|
$depends = $self->_filter_module_dependensies( $module, $depends, |
8
|
|
|
|
|
|
|
$dependency_config ); |
9
|
0
|
|
|
|
|
|
$depends |
10
|
|
|
|
|
|
|
= $self->_filter_global_dependencies( $depends, $dependency_config ); |
11
|
0
|
0
|
|
|
|
|
wantarray ? @$depends : $depends; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _filter_global_dependencies { |
15
|
0
|
|
|
0
|
|
|
my ( $self, $depends, $conf ) = @_; |
16
|
0
|
0
|
|
|
|
|
my $no_depends |
17
|
|
|
|
|
|
|
= $conf->{global}->{no_depends} ? $conf->{global}->{no_depends} : []; |
18
|
0
|
0
|
|
|
|
|
$depends = $self->_first_list_uniq( |
19
|
0
|
0
|
|
|
|
|
[ map { ref $_ eq "HASH" ? $_->{module} : $_ } @{ $depends || () } ], |
|
0
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
[ map { $_->{module} } @{ $no_depends || () } ] |
|
0
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
); |
22
|
0
|
0
|
|
|
|
|
wantarray ? @$depends : $depends; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _filter_module_dependensies { |
26
|
0
|
|
|
0
|
|
|
my ( $self, $module, $depends, $conf ) = @_; |
27
|
0
|
0
|
0
|
|
|
|
my $no_depends |
28
|
|
|
|
|
|
|
= $conf->{modules}->{$module} |
29
|
|
|
|
|
|
|
&& $conf->{modules}->{$module}->{no_depends} |
30
|
|
|
|
|
|
|
? $conf->{modules}->{$module}->{no_depends} |
31
|
|
|
|
|
|
|
: []; |
32
|
0
|
0
|
|
|
|
|
$depends = $self->_first_list_uniq( |
33
|
0
|
0
|
|
|
|
|
[ map { ref $_ eq "HASH" ? $_->{module} : $_ } @{ $depends || () } ], |
|
0
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
[ map { $_->{module} } @{ $no_depends } ] |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
); |
36
|
0
|
0
|
|
|
|
|
wantarray ? @$depends : $depends; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _first_list_uniq { |
40
|
0
|
|
|
0
|
|
|
my ( $self, $depends, $no_depends ) = @_; |
41
|
0
|
|
|
|
|
|
my @new_depends = List::Compare->new( $depends, $no_depends )->get_unique; |
42
|
0
|
0
|
|
|
|
|
wantarray ? @new_depends : \@new_depends; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |