line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Shipwright::Source::HTTP; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
828
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
10
|
use File::Spec::Functions qw/catfile/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
81
|
|
6
|
2
|
|
|
2
|
|
11
|
use Shipwright::Source::Compressed; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
46
|
use base qw/Shipwright::Source::Base/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
126
|
|
9
|
2
|
|
|
2
|
|
10
|
use Shipwright::Util; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
585
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head2 run |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub run { |
16
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$self->log->info( "preparing to run source: " . $self->source ); |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
if ( $self->_run ) { |
21
|
0
|
|
|
|
|
|
my $compressed = |
22
|
|
|
|
|
|
|
Shipwright::Source::Compressed->new( %$self, _no_update_url => 1 ); |
23
|
0
|
|
|
|
|
|
$compressed->run(); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 _run |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _run { |
32
|
0
|
|
|
0
|
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
my $source = $self->source; |
34
|
0
|
|
|
|
|
|
my $file; |
35
|
0
|
0
|
|
|
|
|
if ( $source =~ m{.*/(.+\.(tar\.gz|tgz|tar\.bz2))$} ) { |
36
|
0
|
|
|
|
|
|
$file = $1; |
37
|
0
|
|
|
|
|
|
$self->_update_url( $self->just_name($file), $source ); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $src_dir = $self->download_directory; |
40
|
0
|
0
|
|
|
|
|
mkdir $src_dir unless -e $src_dir; |
41
|
0
|
|
|
|
|
|
$self->source( catfile( $src_dir, $file ) ); |
42
|
0
|
|
|
|
|
|
$self->_lwp_get($source); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else { |
45
|
0
|
|
|
|
|
|
confess_or_die "invalid source: $source"; |
46
|
|
|
|
|
|
|
} |
47
|
0
|
|
|
|
|
|
return 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |