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