line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Shipwright::Source::SVN; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
815
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
46
|
|
5
|
2
|
|
|
2
|
|
8
|
use Shipwright::Util; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
189
|
|
6
|
2
|
|
|
2
|
|
10
|
use File::Spec::Functions qw/catdir/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
84
|
|
7
|
2
|
|
|
2
|
|
61
|
use File::Path qw/remove_tree/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
93
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use base qw/Shipwright::Source::Base/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
794
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head2 new |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
1
|
|
|
1
|
1
|
3
|
my $class = shift; |
17
|
1
|
|
|
|
|
7
|
my $self = $class->SUPER::new(@_); |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
|
|
16
|
$self->name( $self->just_name( $self->source ) ) unless $self->name; |
20
|
1
|
|
|
|
|
4
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 run |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub run { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
$self->log->info( "preparing to run source: " . $self->source ); |
30
|
0
|
|
|
|
|
|
$self->_update_url( $self->name, 'svn:' . $self->source ); |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$self->_run; |
33
|
0
|
|
|
|
|
|
my $s; |
34
|
0
|
0
|
|
|
|
|
if ( $self->is_compressed ) { |
35
|
0
|
|
|
|
|
|
require Shipwright::Source::Compressed; |
36
|
0
|
|
|
|
|
|
$s = Shipwright::Source::Compressed->new( %$self, _no_update_url => 1 ); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else { |
39
|
0
|
|
|
|
|
|
require Shipwright::Source::Directory; |
40
|
0
|
|
|
|
|
|
$s = Shipwright::Source::Directory->new( %$self, _no_update_url => 1 ); |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
$s->run(@_); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 _run |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _run { |
50
|
0
|
|
|
0
|
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
my $source = $self->source; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my $path = catdir( $self->download_directory, $self->name ); |
54
|
0
|
0
|
|
|
|
|
my $cmd = [ |
55
|
|
|
|
|
|
|
$ENV{'SHIPWRIGHT_SVN'}, 'export', |
56
|
|
|
|
|
|
|
$self->source, $path, |
57
|
|
|
|
|
|
|
$self->version ? ( '-r', $self->version ) : (), |
58
|
|
|
|
|
|
|
]; |
59
|
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
unless ( $self->version ) { |
61
|
0
|
|
|
|
|
|
my ($out) = |
62
|
|
|
|
|
|
|
run_cmd( [ $ENV{'SHIPWRIGHT_SVN'}, 'info', $source, ] ); |
63
|
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
|
if ( $out =~ /^Revision: (\d+)/m ) { |
65
|
0
|
|
|
|
|
|
$self->version($1); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
remove_tree($path) if -e $path; |
70
|
0
|
|
|
|
|
|
$self->source( $path ); |
71
|
0
|
|
|
|
|
|
run_cmd($cmd); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |