line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Install::CPANfile; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
35132
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
29
|
use 5.008_001; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
774
|
use Module::CPANfile; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
38
|
|
8
|
1
|
|
|
1
|
|
8
|
use base qw(Module::Install::Base); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
737
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub merge_meta_with_cpanfile { |
11
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
require CPAN::Meta; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $file = Module::CPANfile->load; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if ($self->is_admin) { |
18
|
|
|
|
|
|
|
# force generate META.json |
19
|
0
|
|
|
|
|
|
CPAN::Meta->load_file('META.yml')->save('META.json'); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
print "Regenerate META.json and META.yml using cpanfile\n"; |
22
|
0
|
|
|
|
|
|
$file->merge_meta('META.yml'); |
23
|
0
|
|
|
|
|
|
$file->merge_meta('META.json'); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
for my $metafile (grep -e, qw(MYMETA.yml MYMETA.json)) { |
27
|
0
|
|
|
|
|
|
print "Merging cpanfile prereqs to $metafile\n"; |
28
|
0
|
|
|
|
|
|
$file->merge_meta($metafile); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub cpanfile { |
33
|
0
|
|
|
0
|
0
|
|
my($self, %options) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
$self->dynamic_config(0) unless $options{dynamic}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $write_all = \&::WriteAll; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
*main::WriteAll = sub { |
40
|
0
|
|
|
0
|
|
|
$write_all->(@_); |
41
|
0
|
|
|
|
|
|
$self->merge_meta_with_cpanfile; |
42
|
0
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$self->configure_requires("CPAN::Meta"); |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
if ($self->is_admin) { |
47
|
0
|
|
|
|
|
|
$self->admin->include_one_dist("Module::CPANfile"); |
48
|
0
|
0
|
|
|
|
|
if (eval { require CPAN::Meta::Check; 1 }) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
my $prereqs = Module::CPANfile->load->prereqs; |
50
|
0
|
|
|
|
|
|
my @err = CPAN::Meta::Check::verify_dependencies($prereqs, [qw/runtime build test develop/], 'requires'); |
51
|
0
|
|
|
|
|
|
for (@err) { |
52
|
0
|
|
|
|
|
|
warn "Warning: $_\n"; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} else { |
55
|
0
|
|
|
|
|
|
warn "CPAN::Meta::Check is not installed. Skipping dependencies check for the author.\n"; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
__END__ |