line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Pull upstream distributions into the repository |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::Action::Pull; |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
16472
|
use Moose; |
|
11
|
|
|
|
|
3909
|
|
|
11
|
|
|
|
|
262
|
|
6
|
11
|
|
|
11
|
|
115699
|
use MooseX::StrictConstructor; |
|
11
|
|
|
|
|
62
|
|
|
11
|
|
|
|
|
196
|
|
7
|
11
|
|
|
11
|
|
51534
|
use MooseX::Types::Moose qw(Bool); |
|
11
|
|
|
|
|
60
|
|
|
11
|
|
|
|
|
298
|
|
8
|
11
|
|
|
11
|
|
70361
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
11
|
|
|
|
|
93
|
|
|
11
|
|
|
|
|
179
|
|
9
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
|
55627
|
use Try::Tiny; |
|
11
|
|
|
|
|
53
|
|
|
11
|
|
|
|
|
1221
|
|
11
|
|
|
|
|
|
|
|
12
|
11
|
|
|
11
|
|
102
|
use Pinto::Util qw(throw); |
|
11
|
|
|
|
|
58
|
|
|
11
|
|
|
|
|
847
|
|
13
|
11
|
|
|
11
|
|
83
|
use Pinto::Types qw(TargetList); |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
173
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.13'; # VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
extends qw( Pinto::Action ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has targets => ( |
26
|
|
|
|
|
|
|
isa => TargetList, |
27
|
|
|
|
|
|
|
traits => [qw(Array)], |
28
|
|
|
|
|
|
|
handles => { targets => 'elements' }, |
29
|
|
|
|
|
|
|
required => 1, |
30
|
|
|
|
|
|
|
coerce => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has no_fail => ( |
34
|
|
|
|
|
|
|
is => 'ro', |
35
|
|
|
|
|
|
|
isa => Bool, |
36
|
|
|
|
|
|
|
default => 0, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
with qw( Pinto::Role::Committable Pinto::Role::Puller ); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub execute { |
46
|
|
|
|
|
|
|
my ($self) = @_; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $stack = $self->stack; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
for my $target ( $self->targets ) { |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
try { |
53
|
|
|
|
|
|
|
$self->repo->svp_begin; |
54
|
|
|
|
|
|
|
$self->notice( "Pulling target $target to stack $stack"); |
55
|
|
|
|
|
|
|
my ($dist, $did_pull, $did_pull_prereqs) = $self->pull( target => $target ); |
56
|
|
|
|
|
|
|
$self->notice("Target $target is already on stack $stack") unless $did_pull; |
57
|
|
|
|
|
|
|
push @{$self->affected}, $dist if $did_pull || $did_pull_prereqs; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
catch { |
60
|
|
|
|
|
|
|
throw $_ unless $self->no_fail; |
61
|
|
|
|
|
|
|
$self->result->failed( because => $_ ); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$self->repo->svp_rollback; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$self->error($_); |
66
|
|
|
|
|
|
|
$self->error("Target $target failed...continuing anyway"); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
finally { |
69
|
|
|
|
|
|
|
my ($error) = @_; |
70
|
|
|
|
|
|
|
$self->repo->svp_release unless $error; |
71
|
|
|
|
|
|
|
}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
$self->chrome->progress_done; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
return $self; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=pod |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=encoding UTF-8 |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 NAME |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Pinto::Action::Pull - Pull upstream distributions into the repository |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 VERSION |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
version 0.13 |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
112
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |