line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Boxer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding UTF-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Boxer - system deployment ninja tricks |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
5
|
|
4965
|
use v5.20; |
|
5
|
|
|
|
|
24
|
|
12
|
5
|
|
|
5
|
|
23
|
use utf8; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
28
|
|
13
|
5
|
|
|
5
|
|
945
|
use Role::Commons -all; |
|
5
|
|
|
|
|
45487
|
|
|
5
|
|
|
|
|
34
|
|
14
|
5
|
|
|
5
|
|
55893
|
use feature 'signatures'; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
507
|
|
15
|
5
|
|
|
5
|
|
903
|
use namespace::autoclean 0.16; |
|
5
|
|
|
|
|
17567
|
|
|
5
|
|
|
|
|
29
|
|
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
5
|
|
2560
|
use Module::Find; |
|
5
|
|
|
|
|
6550
|
|
|
5
|
|
|
|
|
319
|
|
18
|
5
|
|
|
5
|
|
2405
|
use Module::Load::Conditional qw(can_load); |
|
5
|
|
|
|
|
112256
|
|
|
5
|
|
|
|
|
291
|
|
19
|
5
|
|
|
5
|
|
516
|
use Log::Any qw($log); |
|
5
|
|
|
|
|
8530
|
|
|
5
|
|
|
|
|
39
|
|
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
5
|
|
3266
|
use strictures 2; |
|
5
|
|
|
|
|
37
|
|
|
5
|
|
|
|
|
204
|
|
22
|
5
|
|
|
5
|
|
972
|
no warnings "experimental::signatures"; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1658
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 VERSION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Version v1.4.2 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our $VERSION = "v1.4.2"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
use Boxer; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $domain = Boxer->get_world('Reclass')->new( suite => 'stretch', data => 'examples' ); |
37
|
|
|
|
|
|
|
say $domain->list_parts(); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $goal = $domain->get_part('lxp5'); |
40
|
|
|
|
|
|
|
my $plan = $domain->map( $goal, 1 ); |
41
|
|
|
|
|
|
|
$plan->as_file( Boxer::File::WithSkeleton->new( basename => 'preseed.cfg' ) ); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $serializer = Boxer::File::WithSkeleton->new( skeleton => 'script.sh.in' ); |
44
|
|
|
|
|
|
|
$plan->as_file( $serializer->file( 'script.sh', 1 ) ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $anothergoal = $domain->get_part('parl-greens'); |
47
|
|
|
|
|
|
|
my $anotherplan = $domain->map($anothergoal); |
48
|
|
|
|
|
|
|
$anotherplan->as_file( $serializer->file( 'parl-greens.sh', 1 ) ); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $newdomain = Boxer->get_world()->new( suite => 'buster', data => 'examples' ); |
51
|
|
|
|
|
|
|
my $plan_a = $newdomain->map($goal); |
52
|
|
|
|
|
|
|
$plan_a->as_file( Boxer::File::WithSkeleton->new( basename => 'preseed_pure.cfg' ) ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Framework for system deployment ninja tricks. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
See L<boxer> for further information. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub list_worlds ($self) |
63
|
11
|
|
|
11
|
0
|
1529
|
{ |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
22
|
|
64
|
11
|
|
|
|
|
44
|
return findsubmod Boxer::World; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub get_world |
68
|
|
|
|
|
|
|
{ |
69
|
10
|
|
|
10
|
0
|
19046
|
my ( $self, $name ) = @_; |
70
|
|
|
|
|
|
|
|
71
|
10
|
|
100
|
|
|
38
|
$name ||= 'flat'; |
72
|
|
|
|
|
|
|
|
73
|
10
|
|
|
|
|
33
|
foreach my $world ( $self->list_worlds() ) { |
74
|
14
|
100
|
|
|
|
15087
|
if ( lc( substr( $world, -( length($name) + 2 ) ) ) eq lc("::$name") ) |
75
|
|
|
|
|
|
|
{ |
76
|
9
|
50
|
|
|
|
54
|
unless ( can_load( modules => { $world => 0 } ) ) { |
77
|
0
|
|
|
|
|
0
|
$log->error($Module::Load::Conditional::ERROR); |
78
|
0
|
|
|
|
|
0
|
return; |
79
|
|
|
|
|
|
|
} |
80
|
9
|
|
|
|
|
6436
|
return $world; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
} |
83
|
1
|
|
|
|
|
18
|
$log->error("No world \"$name\" found"); |
84
|
1
|
|
|
|
|
70
|
return; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 BUGS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Please report any bugs to |
90
|
|
|
|
|
|
|
L<http://rt.cpan.org/Dist/Display.html?Queue=Boxer>. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 SEE ALSO |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
L<Debian Installer|https://www.debian.org/devel/debian-installer/>, |
95
|
|
|
|
|
|
|
L<tasksel|https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html#s-tasksel>, |
96
|
|
|
|
|
|
|
L<debconf preseeding|https://wiki.debian.org/DebianInstaller/Preseed>, |
97
|
|
|
|
|
|
|
L<Hands-off|http://hands.com/d-i/> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L<Debian Pure Blends|https://wiki.debian.org/DebianPureBlends> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L<Footprintless> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L<FAI class system|https://fai-project.org/fai-guide/#defining%20classes> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
L<Elbe commands|https://elbe-rfs.org/docs/sphinx/elbe.html> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
L<isar|https://github.com/ilbers/isar> |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
L<Debathena config-package-dev|https://debathena.mit.edu/config-packages/> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
L<germinate|https://wiki.ubuntu.com/Germinate> |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
L<https://freedombox.org/>, |
114
|
|
|
|
|
|
|
L<https://solidbox.org/>, |
115
|
|
|
|
|
|
|
L<https://wiki.debian.org/Design>, |
116
|
|
|
|
|
|
|
L<https://wiki.debian.org/DebianParl>, |
117
|
|
|
|
|
|
|
L<http://box.redpill.dk/> |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 AUTHOR |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Jonas Smedegaard C<< <dr@jones.dk> >>. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JONASS'; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Copyright © 2013-2016 Jonas Smedegaard |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
132
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
137
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
138
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
1; |