line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
207626
|
use 5.006; |
|
4
|
|
|
|
|
14
|
|
2
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
103
|
|
3
|
4
|
|
|
4
|
|
28
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
323
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Gentoo::Util::VirtualDepend; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.003023'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Hard-coded replacements for perl-core/ dependencies and dependencies with odd names in Gentoo |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
4
|
|
|
4
|
|
2208
|
use Moo qw( has ); |
|
4
|
|
|
|
|
54992
|
|
|
4
|
|
|
|
|
25
|
|
14
|
4
|
|
|
4
|
|
7759
|
use Path::Tiny qw( path ); |
|
4
|
|
|
|
|
14783
|
|
|
4
|
|
|
|
|
322
|
|
15
|
4
|
|
|
4
|
|
891
|
use File::ShareDir qw( dist_file ); |
|
4
|
|
|
|
|
7471
|
|
|
4
|
|
|
|
|
314
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Note: this should be the version default max_perl is in |
18
|
4
|
|
|
4
|
|
10551
|
use Module::CoreList 5.20151213; |
|
4
|
|
|
|
|
219982
|
|
|
4
|
|
|
|
|
51
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Note: This should be the latest visible version in portage at time of release |
30
|
|
|
|
|
|
|
has max_perl => ( is => 'ro', lazy => 1, default => sub { '5.22.1' } ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Note: This should be the lowest visible version 12 months prior to the time of release |
42
|
|
|
|
|
|
|
has min_perl => ( is => 'ro', lazy => 1, default => sub { '5.18.2' } ); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my %MOD2GENTOO; |
45
|
|
|
|
|
|
|
my $MOD2GENTOO_LOADED; |
46
|
|
|
|
|
|
|
my $MOD2GENTOO_FILE = 'module-to-gentoo.csv'; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my %DIST2GENTOO; |
49
|
|
|
|
|
|
|
my $DIST2GENTOO_LOADED; |
50
|
|
|
|
|
|
|
my $DIST2GENTOO_FILE = 'dist-to-gentoo.csv'; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my %GENTOO2DIST; |
53
|
|
|
|
|
|
|
my %GENTOO2MOD; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $DIST = q[Gentoo-Util-VirtualDepend]; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _load_mod2gentoo { |
58
|
3
|
50
|
|
3
|
|
12
|
return if $MOD2GENTOO_LOADED; |
59
|
3
|
|
|
|
|
20
|
my $fh = path( dist_file( $DIST, $MOD2GENTOO_FILE ) )->openr_raw; |
60
|
3
|
|
|
|
|
1048
|
while ( my $line = <$fh> ) { |
61
|
6897
|
|
|
|
|
4686
|
chomp $line; |
62
|
6897
|
|
|
|
|
9911
|
my ( $module, $map ) = split /,/, $line; ## no critic (RegularExpressions) |
63
|
6897
|
|
|
|
|
12185
|
$MOD2GENTOO{$module} = $map; |
64
|
6897
|
100
|
|
|
|
8948
|
$GENTOO2MOD{$map} = [] unless exists $GENTOO2MOD{$map}; |
65
|
6897
|
|
|
|
|
3998
|
push @{ $GENTOO2MOD{$map} }, $module; |
|
6897
|
|
|
|
|
14617
|
|
66
|
|
|
|
|
|
|
} |
67
|
3
|
|
|
|
|
74
|
return $MOD2GENTOO_LOADED = 1; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub _load_dist2gentoo { |
71
|
1
|
50
|
|
1
|
|
3
|
return if $DIST2GENTOO_LOADED; |
72
|
1
|
|
|
|
|
6
|
my $fh = path( dist_file( $DIST, $DIST2GENTOO_FILE ) )->openr_raw; |
73
|
1
|
|
|
|
|
279
|
while ( my $line = <$fh> ) { |
74
|
120
|
|
|
|
|
79
|
chomp $line; |
75
|
120
|
|
|
|
|
147
|
my ( $module, $map ) = split /,/, $line; ## no critic (RegularExpressions) |
76
|
120
|
|
|
|
|
149
|
$DIST2GENTOO{$module} = $map; |
77
|
120
|
50
|
|
|
|
207
|
$GENTOO2DIST{$map} = [] unless exists $GENTOO2DIST{$map}; |
78
|
120
|
|
|
|
|
70
|
push @{ $GENTOO2DIST{$map} }, $module; |
|
120
|
|
|
|
|
237
|
|
79
|
|
|
|
|
|
|
} |
80
|
1
|
|
|
|
|
29
|
return $DIST2GENTOO_LOADED = 1; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub has_module_override { |
84
|
189
|
|
|
189
|
1
|
21805
|
my ( undef, $module ) = @_; |
85
|
189
|
100
|
|
|
|
270
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
86
|
189
|
|
|
|
|
317
|
return exists $MOD2GENTOO{$module}; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub get_module_override { |
90
|
30
|
|
|
30
|
1
|
76
|
my ( undef, $module ) = @_; |
91
|
30
|
50
|
|
|
|
41
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
92
|
30
|
|
|
|
|
53
|
return $MOD2GENTOO{$module}; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub has_dist_override { |
96
|
2
|
|
|
2
|
1
|
5
|
my ( undef, $dist ) = @_; |
97
|
2
|
100
|
|
|
|
10
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
98
|
2
|
|
|
|
|
8
|
return exists $DIST2GENTOO{$dist}; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub get_dist_override { |
102
|
1
|
|
|
1
|
1
|
2
|
my ( undef, $dist ) = @_; |
103
|
1
|
50
|
|
|
|
4
|
_load_mod2gentoo unless $DIST2GENTOO_LOADED; |
104
|
1
|
|
|
|
|
4
|
return $DIST2GENTOO{$dist}; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub has_gentoo_package { |
108
|
0
|
|
|
0
|
1
|
0
|
my ( undef, $package ) = @_; |
109
|
0
|
0
|
|
|
|
0
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
110
|
0
|
|
|
|
|
0
|
return exists $GENTOO2DIST{$package}; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub get_dists_in_gentoo_package { |
114
|
0
|
|
|
0
|
1
|
0
|
my ( undef, $package ) = @_; |
115
|
0
|
0
|
|
|
|
0
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
116
|
0
|
0
|
|
|
|
0
|
return @{ $GENTOO2DIST{$package} || [] }; |
|
0
|
|
|
|
|
0
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub get_modules_in_gentoo_package { |
120
|
0
|
|
|
0
|
1
|
0
|
my ( undef, $package ) = @_; |
121
|
0
|
0
|
|
|
|
0
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
122
|
0
|
0
|
|
|
|
0
|
return @{ $GENTOO2MOD{$package} || [] }; |
|
0
|
|
|
|
|
0
|
|
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub get_known_gentoo_packages { |
126
|
0
|
0
|
|
0
|
1
|
0
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
127
|
0
|
|
|
|
|
0
|
return keys %GENTOO2DIST; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub get_known_dists { |
131
|
0
|
0
|
|
0
|
1
|
0
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
132
|
0
|
|
|
|
|
0
|
return keys %DIST2GENTOO; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub get_known_modules { |
136
|
0
|
0
|
|
0
|
1
|
0
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
137
|
0
|
|
|
|
|
0
|
return keys %MOD2GENTOO; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub module_is_perl { |
141
|
83
|
|
|
83
|
1
|
204
|
my ( $self, $opts, $module, $mod_version ) = @_; |
142
|
83
|
100
|
|
|
|
139
|
if ( not ref $opts ) { |
143
|
75
|
|
|
|
|
117
|
( $opts, $module, $mod_version ) = ( {}, $opts, $module ); |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
# If the module has a virtual, don't even consider |
147
|
|
|
|
|
|
|
# CPAN/perl decisions |
148
|
|
|
|
|
|
|
|
149
|
83
|
50
|
|
|
|
108
|
return if $self->has_module_override($module); |
150
|
83
|
|
|
|
|
341
|
require version; |
151
|
|
|
|
|
|
|
|
152
|
83
|
|
66
|
|
|
1507
|
$opts->{min_perl} ||= $self->min_perl; |
153
|
83
|
|
|
|
|
680
|
my $min_perl = version->parse( $opts->{min_perl} ); |
154
|
83
|
|
66
|
|
|
1034
|
$opts->{max_perl} ||= $self->max_perl; |
155
|
83
|
|
|
|
|
564
|
my $max_perl = version->parse( $opts->{max_perl} ); |
156
|
|
|
|
|
|
|
|
157
|
83
|
|
|
|
|
57
|
my $seen; |
158
|
|
|
|
|
|
|
## no critic (Variables::ProhibitPackageVars) |
159
|
83
|
|
|
|
|
1206
|
for my $version ( keys %Module::CoreList::version ) { |
160
|
1766
|
|
|
|
|
4458
|
my $perlver = version->parse($version); |
161
|
|
|
|
|
|
|
## no critic (ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions) |
162
|
1766
|
100
|
|
|
|
4506
|
next unless $perlver >= $min_perl; |
163
|
718
|
100
|
|
|
|
1588
|
next unless $perlver <= $max_perl; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
# If any version in the range returns "deprecated", then we should |
166
|
|
|
|
|
|
|
# default to CPAN |
167
|
240
|
100
|
|
|
|
754
|
return if $Module::CoreList::deprecated{$version}{$module}; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
# If any version in the range does not exist, then we should default to CPAN |
170
|
|
|
|
|
|
|
# |
171
|
235
|
100
|
|
|
|
46176
|
return if not exists $Module::CoreList::version{$version}{$module}; |
172
|
|
|
|
|
|
|
|
173
|
165
|
100
|
|
|
|
6904
|
if ( not defined $mod_version ) { |
174
|
68
|
|
|
|
|
62
|
$seen = 1; |
175
|
68
|
|
|
|
|
139
|
next; |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# If any version in the range is undef, and a specific version is requested, |
179
|
|
|
|
|
|
|
# Default to CPAN, because it means a virtual is not provisioned. |
180
|
97
|
50
|
|
|
|
197
|
return if not defined $Module::CoreList::version{$version}{$module}; |
181
|
|
|
|
|
|
|
|
182
|
97
|
|
|
|
|
4431
|
my $this_version = version->parse( $Module::CoreList::version{$version}{$module} ); |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# If any version in the range is lower than required, default to CPAN |
185
|
|
|
|
|
|
|
# because it means a virtual is not provisioned, and a breakage will occur |
186
|
|
|
|
|
|
|
# on one of the versions. |
187
|
97
|
100
|
|
|
|
4760
|
return if $this_version < version->parse($mod_version); |
188
|
|
|
|
|
|
|
|
189
|
96
|
|
|
|
|
217
|
$seen = 1; |
190
|
|
|
|
|
|
|
} |
191
|
7
|
|
|
|
|
97
|
return $seen; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
4
|
|
|
4
|
|
6473
|
no Moo; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
37
|
|
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
1; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
__END__ |