line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Build::Prereq; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
27066
|
use 5.010000; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
13
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
4325
|
use Module::CoreList; |
|
1
|
|
|
|
|
92849
|
|
|
1
|
|
|
|
|
17
|
|
7
|
1
|
|
|
1
|
|
618
|
use File::Find; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
875
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
our @EXPORT = qw(assert_modules); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub assert_modules { |
16
|
3
|
|
|
3
|
1
|
82561
|
my %args = @_; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
10
|
my %modules = (); |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
|
|
9
|
my $skips = $args{ignore_modules}; |
21
|
3
|
|
50
|
|
|
16
|
my $finds = $args{module_paths} || ['lib']; |
22
|
3
|
|
33
|
|
|
10
|
my $ext = $args{pm_extension} || qr(\.[Pp][Mm]$); |
23
|
|
|
|
|
|
|
|
24
|
15
|
|
|
15
|
|
23
|
find( sub { my $file = $_; |
25
|
15
|
100
|
|
|
|
640
|
return unless $file =~ $ext; |
26
|
|
|
|
|
|
|
|
27
|
9
|
50
|
|
|
|
306
|
open my $fh, "<", $file or do { warn "Unable to open $file: $!\n"; return; }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
28
|
9
|
|
|
|
|
116
|
while( my $module = <$fh> ) { |
29
|
51
|
100
|
|
|
|
278
|
next unless $module =~ s/^use (\S+).*;.*/$1/; |
30
|
33
|
|
|
|
|
50
|
chomp $module; |
31
|
33
|
50
|
|
|
|
85
|
next if $module =~ /^\d/; # version pragma |
32
|
33
|
100
|
|
|
|
132
|
next if exists $args{prereq_pm}->{$module}; |
33
|
22
|
50
|
33
|
|
|
49
|
next if defined $skips and $module =~ $skips; |
34
|
|
|
|
|
|
|
|
35
|
22
|
|
|
|
|
81
|
$modules{$module} = $File::Find::name; |
36
|
|
|
|
|
|
|
} |
37
|
9
|
|
|
|
|
295
|
close $fh; |
38
|
3
|
|
|
|
|
385
|
}, @$finds ); |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
44
|
my $mod = join('|', sort keys %modules); |
41
|
3
|
|
|
|
|
189
|
my @core = Module::CoreList->find_modules(qr/^(?:$mod)$/); |
42
|
3
|
|
|
|
|
3768656
|
delete @modules{@core}; |
43
|
|
|
|
|
|
|
|
44
|
3
|
100
|
|
|
|
22
|
if (scalar keys %modules) { |
45
|
2
|
|
|
|
|
10
|
my @missing = map { " $_ (used by $modules{$_})" } sort keys %modules; |
|
7
|
|
|
|
|
29
|
|
46
|
2
|
|
|
|
|
41
|
die "Missing modules:\n" . join("\n", @missing) . "\n"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
16
|
return 1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |