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