line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Packager::Downloader::CPAN; |
2
|
1
|
|
|
1
|
|
7
|
use Mouse; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
3
|
1
|
|
|
1
|
|
5437
|
use CPAN; |
|
1
|
|
|
|
|
1101355
|
|
|
1
|
|
|
|
|
706
|
|
4
|
1
|
|
|
1
|
|
31
|
use Try::Tiny; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
99
|
|
5
|
1
|
|
|
1
|
|
9
|
use Log::Log4perl qw(:easy); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
23
|
|
6
|
|
|
|
|
|
|
with 'CPAN::Packager::Downloader::Role'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub set_cpan_mirrors { |
9
|
0
|
|
|
0
|
0
|
|
my ( $self, $cpan_mirrors ) = @_; |
10
|
0
|
|
|
|
|
|
$CPAN::Config->{'urllist'} = $cpan_mirrors; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub download { |
14
|
0
|
|
|
0
|
0
|
|
my ( $self, $module ) = @_; |
15
|
0
|
|
|
|
|
|
INFO("Downloading $module ..."); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $mod = CPAN::Shell->expand( "Module", $module ); |
18
|
0
|
0
|
|
|
|
|
return unless $mod; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $dist = $mod->distribution; |
21
|
0
|
0
|
|
|
|
|
return unless $dist; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my ( $archive, $where ); |
24
|
|
|
|
|
|
|
try { |
25
|
0
|
|
|
0
|
|
|
$dist->get(); |
26
|
0
|
|
|
|
|
|
$archive = $dist->{localfile}; # FIXME: old CPAN does't have method? |
27
|
0
|
|
|
|
|
|
$where = $dist->dir(); |
28
|
0
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
return () unless $archive; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return $self->analyze_distname_info( $archive, $where ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
1
|
|
2871
|
no Mouse; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
38
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |