line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Boxer::World::Flat; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=encoding UTF-8 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Boxer::World::Flat - software for single use case |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
6
|
|
|
6
|
|
3278
|
use v5.20; |
|
6
|
|
|
|
|
22
|
|
12
|
6
|
|
|
6
|
|
33
|
use utf8; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
35
|
|
13
|
6
|
|
|
6
|
|
165
|
use Role::Commons -all; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
40
|
|
14
|
6
|
|
|
6
|
|
10141
|
use feature 'signatures'; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
639
|
|
15
|
6
|
|
|
6
|
|
37
|
use namespace::autoclean 0.16; |
|
6
|
|
|
|
|
100
|
|
|
6
|
|
|
|
|
39
|
|
16
|
6
|
|
|
6
|
|
809
|
use autodie; |
|
6
|
|
|
|
|
11120
|
|
|
6
|
|
|
|
|
32
|
|
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
6
|
|
29933
|
use Moo; |
|
6
|
|
|
|
|
2264
|
|
|
6
|
|
|
|
|
27
|
|
19
|
6
|
|
|
6
|
|
3897
|
use MooX::StrictConstructor; |
|
6
|
|
|
|
|
2100
|
|
|
6
|
|
|
|
|
36
|
|
20
|
|
|
|
|
|
|
extends qw(Boxer::World); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
|
6
|
|
24204
|
use Types::Standard qw( Maybe Bool Tuple ); |
|
6
|
|
|
|
|
51931
|
|
|
6
|
|
|
|
|
74
|
|
23
|
6
|
|
|
6
|
|
5827
|
use Types::TypeTiny qw( StringLike ArrayLike ); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
35
|
|
24
|
|
|
|
|
|
|
|
25
|
6
|
|
|
6
|
|
1525
|
use strictures 2; |
|
6
|
|
|
|
|
57
|
|
|
6
|
|
|
|
|
243
|
|
26
|
6
|
|
|
6
|
|
1192
|
no warnings "experimental::signatures"; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
3790
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 VERSION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Version v1.4.2 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $VERSION = "v1.4.2"; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Outside the box is a world of software. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
B<Boxer::World::Flat> is a class describing a collection of software |
41
|
|
|
|
|
|
|
available for installation into (or as) an operating system. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L<Boxer>. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has parts => ( |
50
|
|
|
|
|
|
|
is => 'ro', |
51
|
|
|
|
|
|
|
isa => Tuple [], |
52
|
|
|
|
|
|
|
default => sub { [] }, |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has node => ( |
56
|
|
|
|
|
|
|
is => 'ro', |
57
|
|
|
|
|
|
|
isa => StringLike, |
58
|
|
|
|
|
|
|
required => 1, |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
has epoch => ( |
62
|
|
|
|
|
|
|
is => 'ro', |
63
|
|
|
|
|
|
|
isa => Maybe [StringLike], |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
has pkgs => ( |
67
|
|
|
|
|
|
|
is => 'ro', |
68
|
|
|
|
|
|
|
isa => ArrayLike, |
69
|
|
|
|
|
|
|
required => 1, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
has pkgs_auto => ( |
73
|
|
|
|
|
|
|
is => 'ro', |
74
|
|
|
|
|
|
|
isa => ArrayLike, |
75
|
|
|
|
|
|
|
required => 1, |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
has pkgs_avoid => ( |
79
|
|
|
|
|
|
|
is => 'ro', |
80
|
|
|
|
|
|
|
isa => ArrayLike, |
81
|
|
|
|
|
|
|
required => 1, |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
has tweaks => ( |
85
|
|
|
|
|
|
|
is => 'ro', |
86
|
|
|
|
|
|
|
isa => ArrayLike, |
87
|
|
|
|
|
|
|
required => 1, |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
has pkgdesc => ( |
91
|
|
|
|
|
|
|
is => 'ro', |
92
|
|
|
|
|
|
|
isa => StringLike, |
93
|
|
|
|
|
|
|
required => 1, |
94
|
|
|
|
|
|
|
); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
has tweakdesc => ( |
97
|
|
|
|
|
|
|
is => 'ro', |
98
|
|
|
|
|
|
|
isa => StringLike, |
99
|
|
|
|
|
|
|
required => 1, |
100
|
|
|
|
|
|
|
); |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
has nonfree => ( |
103
|
|
|
|
|
|
|
is => 'ro', |
104
|
|
|
|
|
|
|
isa => Bool, |
105
|
|
|
|
|
|
|
required => 1, |
106
|
|
|
|
|
|
|
); |
107
|
|
|
|
|
|
|
|
108
|
8
|
|
|
|
|
16
|
sub as_file ( $self, $file, $oldstyle = 0 ) |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
14
|
|
109
|
8
|
|
|
8
|
0
|
15
|
{ |
|
8
|
|
|
|
|
10
|
|
110
|
8
|
|
|
|
|
15
|
my $pkgs = join( ',', sort @{ $self->pkgs } ); |
|
8
|
|
|
|
|
202
|
|
111
|
8
|
|
|
|
|
17
|
my $pkgs_avoid = join( ',', sort @{ $self->pkgs_avoid } ); |
|
8
|
|
|
|
|
39
|
|
112
|
8
|
|
|
|
|
15
|
my $pkgs_auto = join( ',', sort @{ $self->pkgs_auto } ); |
|
8
|
|
|
|
|
45
|
|
113
|
8
|
|
|
|
|
15
|
my $tweaks = join( ";\\\n ", @{ $self->tweaks } ); |
|
8
|
|
|
|
|
30
|
|
114
|
|
|
|
|
|
|
|
115
|
8
|
|
|
|
|
15
|
my $pkglist = join( ' ', sort @{ $self->pkgs } ); |
|
8
|
|
|
|
|
151
|
|
116
|
8
|
|
|
|
|
18
|
$pkglist .= " \\\n "; |
117
|
8
|
|
|
|
|
15
|
$pkglist .= join( ' ', sort map { $_ . '-' } @{ $self->pkgs_avoid } ); |
|
30
|
|
|
|
|
100
|
|
|
8
|
|
|
|
|
18
|
|
118
|
8
|
|
|
|
|
19
|
my $pkgautolist = join( ' ', sort @{ $self->pkgs_auto } ); |
|
8
|
|
|
|
|
40
|
|
119
|
|
|
|
|
|
|
|
120
|
8
|
|
|
|
|
19
|
my $tweaks_perl = $tweaks; |
121
|
8
|
|
|
|
|
21
|
$tweaks_perl =~ s,chroot\s+/target\s+,,g; |
122
|
8
|
|
|
|
|
20
|
$tweaks_perl =~ s,/target/,/,g; |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
# TODO: maybe move below (or only $''{ part?) to reclass parser |
125
|
8
|
|
|
|
|
39
|
$tweaks_perl =~ s/\\\K''(?=n)|\$\K''(?=\{)//g; |
126
|
|
|
|
|
|
|
|
127
|
8
|
|
|
|
|
103
|
my %vars = ( |
128
|
|
|
|
|
|
|
node => $self->node, |
129
|
|
|
|
|
|
|
suite => $self->epoch, |
130
|
|
|
|
|
|
|
pkgs => $pkgs, |
131
|
|
|
|
|
|
|
pkgs_avoid => $pkgs_avoid, |
132
|
|
|
|
|
|
|
pkgs_auto => $pkgs_auto, |
133
|
|
|
|
|
|
|
pkgdesc => $self->pkgdesc, |
134
|
|
|
|
|
|
|
pkglist => $pkglist, |
135
|
|
|
|
|
|
|
tweakdesc => $self->tweakdesc, |
136
|
|
|
|
|
|
|
tweaks => $tweaks, |
137
|
|
|
|
|
|
|
tweaks_perl => $tweaks_perl, |
138
|
|
|
|
|
|
|
tweaklist => $tweaks, |
139
|
|
|
|
|
|
|
pkgautolist => $pkgautolist, |
140
|
|
|
|
|
|
|
nonfree => $self->nonfree, |
141
|
|
|
|
|
|
|
); |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# TODO: Drop oldstyle templating format |
144
|
|
|
|
|
|
|
# (oldstyle preseed templates expect perl tweaks in regular tweaks string) |
145
|
8
|
100
|
|
|
|
25
|
if ($oldstyle) { |
146
|
4
|
|
|
|
|
28
|
my %altvars = %vars; |
147
|
4
|
|
|
|
|
12
|
$altvars{tweaklist} = $tweaks_perl; |
148
|
4
|
|
|
|
|
22
|
$file->create( \%altvars ); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
else { |
151
|
4
|
|
|
|
|
24
|
$file->create( \%vars ); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
8
|
|
|
|
|
4526
|
1; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 AUTHOR |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Jonas Smedegaard C<< <dr@jones.dk> >>. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JONASS'; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Copyright © 2013-2016 Jonas Smedegaard |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
170
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
175
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
176
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=cut |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |