line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Register packages from existing archives on a stack |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::Action::Register; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
440
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
5827
|
use MooseX::StrictConstructor; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
2741
|
use MooseX::Types::Moose qw(Bool); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
8
|
1
|
|
|
1
|
|
4096
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
3100
|
use Pinto::Util qw(throw); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
11
|
1
|
|
|
1
|
|
5
|
use Pinto::Types qw(DistributionTargetList); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.14'; # VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
extends qw( Pinto::Action ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has targets => ( |
24
|
|
|
|
|
|
|
isa => DistributionTargetList, |
25
|
|
|
|
|
|
|
traits => [qw(Array)], |
26
|
|
|
|
|
|
|
handles => { targets => 'elements' }, |
27
|
|
|
|
|
|
|
required => 1, |
28
|
|
|
|
|
|
|
coerce => 1, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has pin => ( |
32
|
|
|
|
|
|
|
is => 'ro', |
33
|
|
|
|
|
|
|
isa => Bool, |
34
|
|
|
|
|
|
|
default => 0, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
with qw( Pinto::Role::Committable ); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub execute { |
44
|
|
|
|
|
|
|
my ($self) = @_; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $stack = $self->stack; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
for my $target ( $self->targets ) { |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
throw "Distribution $target is not in the repository" |
51
|
|
|
|
|
|
|
unless my $dist = $self->repo->get_distribution( target => $target ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$self->notice("Registering distribution $dist on stack $stack"); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $did_register = $dist->register( stack => $stack, pin => $self->pin ); |
56
|
|
|
|
|
|
|
push @{$self->affected}, $dist if $did_register; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
$self->warning("Distribution $dist is already registered on stack $stack") |
59
|
|
|
|
|
|
|
unless $did_register; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
return $self; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=pod |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=encoding UTF-8 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Pinto::Action::Register - Register packages from existing archives on a stack |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 VERSION |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
version 0.14 |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
98
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |