line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
279235
|
use 5.006; |
|
4
|
|
|
|
|
12
|
|
2
|
4
|
|
|
4
|
|
19
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
103
|
|
3
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
327
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Gentoo::Util::VirtualDepend; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.003022'; |
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
|
|
2256
|
use Moo qw( has ); |
|
4
|
|
|
|
|
222308
|
|
|
4
|
|
|
|
|
20
|
|
14
|
4
|
|
|
4
|
|
19941
|
use Path::Tiny qw( path ); |
|
4
|
|
|
|
|
15145
|
|
|
4
|
|
|
|
|
290
|
|
15
|
4
|
|
|
4
|
|
820
|
use File::ShareDir qw( dist_file ); |
|
4
|
|
|
|
|
8082
|
|
|
4
|
|
|
|
|
296
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Note: this should be the version default max_perl is in |
18
|
4
|
|
|
4
|
|
10931
|
use Module::CoreList 5.20151213; |
|
4
|
|
|
|
|
256240
|
|
|
4
|
|
|
|
|
127
|
|
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
|
|
16
|
return if $MOD2GENTOO_LOADED; |
59
|
3
|
|
|
|
|
24
|
my $fh = path( dist_file( $DIST, $MOD2GENTOO_FILE ) )->openr_raw; |
60
|
3
|
|
|
|
|
1180
|
while ( my $line = <$fh> ) { |
61
|
6933
|
|
|
|
|
4676
|
chomp $line; |
62
|
6933
|
|
|
|
|
10027
|
my ( $module, $map ) = split /,/, $line; ## no critic (RegularExpressions) |
63
|
6933
|
|
|
|
|
11110
|
$MOD2GENTOO{$module} = $map; |
64
|
6933
|
100
|
|
|
|
9862
|
$GENTOO2MOD{$map} = [] unless exists $GENTOO2MOD{$map}; |
65
|
6933
|
|
|
|
|
4068
|
push @{ $GENTOO2MOD{$map} }, $module; |
|
6933
|
|
|
|
|
14679
|
|
66
|
|
|
|
|
|
|
} |
67
|
3
|
|
|
|
|
48
|
return $MOD2GENTOO_LOADED = 1; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub _load_dist2gentoo { |
71
|
1
|
50
|
|
1
|
|
5
|
return if $DIST2GENTOO_LOADED; |
72
|
1
|
|
|
|
|
8
|
my $fh = path( dist_file( $DIST, $DIST2GENTOO_FILE ) )->openr_raw; |
73
|
1
|
|
|
|
|
384
|
while ( my $line = <$fh> ) { |
74
|
121
|
|
|
|
|
92
|
chomp $line; |
75
|
121
|
|
|
|
|
205
|
my ( $module, $map ) = split /,/, $line; ## no critic (RegularExpressions) |
76
|
121
|
|
|
|
|
184
|
$DIST2GENTOO{$module} = $map; |
77
|
121
|
50
|
|
|
|
289
|
$GENTOO2DIST{$map} = [] unless exists $GENTOO2DIST{$map}; |
78
|
121
|
|
|
|
|
87
|
push @{ $GENTOO2DIST{$map} }, $module; |
|
121
|
|
|
|
|
386
|
|
79
|
|
|
|
|
|
|
} |
80
|
1
|
|
|
|
|
12
|
return $DIST2GENTOO_LOADED = 1; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub has_module_override { |
84
|
189
|
|
|
189
|
1
|
22254
|
my ( undef, $module ) = @_; |
85
|
189
|
100
|
|
|
|
315
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
86
|
189
|
|
|
|
|
364
|
return exists $MOD2GENTOO{$module}; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub get_module_override { |
90
|
30
|
|
|
30
|
1
|
87
|
my ( undef, $module ) = @_; |
91
|
30
|
50
|
|
|
|
45
|
_load_mod2gentoo unless $MOD2GENTOO_LOADED; |
92
|
30
|
|
|
|
|
69
|
return $MOD2GENTOO{$module}; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub has_dist_override { |
96
|
2
|
|
|
2
|
1
|
7
|
my ( undef, $dist ) = @_; |
97
|
2
|
100
|
|
|
|
13
|
_load_dist2gentoo unless $DIST2GENTOO_LOADED; |
98
|
2
|
|
|
|
|
8
|
return exists $DIST2GENTOO{$dist}; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub get_dist_override { |
102
|
1
|
|
|
1
|
1
|
3
|
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
|
236
|
my ( $self, $opts, $module, $mod_version ) = @_; |
142
|
83
|
100
|
|
|
|
143
|
if ( not ref $opts ) { |
143
|
75
|
|
|
|
|
128
|
( $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
|
|
|
|
126
|
return if $self->has_module_override($module); |
150
|
83
|
|
|
|
|
385
|
require version; |
151
|
|
|
|
|
|
|
|
152
|
83
|
|
66
|
|
|
1619
|
$opts->{min_perl} ||= $self->min_perl; |
153
|
83
|
|
|
|
|
777
|
my $min_perl = version->parse( $opts->{min_perl} ); |
154
|
83
|
|
66
|
|
|
1201
|
$opts->{max_perl} ||= $self->max_perl; |
155
|
83
|
|
|
|
|
600
|
my $max_perl = version->parse( $opts->{max_perl} ); |
156
|
|
|
|
|
|
|
|
157
|
83
|
|
|
|
|
76
|
my $seen; |
158
|
|
|
|
|
|
|
## no critic (Variables::ProhibitPackageVars) |
159
|
83
|
|
|
|
|
1567
|
for my $version ( keys %Module::CoreList::version ) { |
160
|
1636
|
|
|
|
|
4504
|
my $perlver = version->parse($version); |
161
|
|
|
|
|
|
|
## no critic (ControlStructures::ProhibitNegativeExpressionsInUnlessAndUntilConditions) |
162
|
1636
|
100
|
|
|
|
4469
|
next unless $perlver >= $min_perl; |
163
|
676
|
100
|
|
|
|
1602
|
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
|
|
|
|
843
|
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
|
|
|
|
49177
|
return if not exists $Module::CoreList::version{$version}{$module}; |
172
|
|
|
|
|
|
|
|
173
|
165
|
100
|
|
|
|
7970
|
if ( not defined $mod_version ) { |
174
|
68
|
|
|
|
|
47
|
$seen = 1; |
175
|
68
|
|
|
|
|
141
|
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
|
|
|
|
264
|
return if not defined $Module::CoreList::version{$version}{$module}; |
181
|
|
|
|
|
|
|
|
182
|
97
|
|
|
|
|
6470
|
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
|
|
|
|
6735
|
return if $this_version < version->parse($mod_version); |
188
|
|
|
|
|
|
|
|
189
|
96
|
|
|
|
|
269
|
$seen = 1; |
190
|
|
|
|
|
|
|
} |
191
|
7
|
|
|
|
|
103
|
return $seen; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
4
|
|
|
4
|
|
7214
|
no Moo; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
37
|
|
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
1; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
__END__ |