line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Packager::Script; |
2
|
1
|
|
|
1
|
|
7
|
use Mouse; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
11
|
|
3
|
1
|
|
|
1
|
|
523
|
use CPAN::Packager; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
6
|
use CPAN::Packager::FileUtil qw(dir file slurp); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
536
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with 'MouseX::Getopt'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'dry_run' => ( |
9
|
|
|
|
|
|
|
is => 'rw', |
10
|
|
|
|
|
|
|
isa => 'Bool', |
11
|
|
|
|
|
|
|
defalut => 0, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'module' => ( |
15
|
|
|
|
|
|
|
is => 'rw', |
16
|
|
|
|
|
|
|
isa => 'Str', |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'builder' => ( |
20
|
|
|
|
|
|
|
is => 'rw', |
21
|
|
|
|
|
|
|
isa => 'Str', |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has 'downloader' => ( |
26
|
|
|
|
|
|
|
is => 'rw', |
27
|
|
|
|
|
|
|
isa => 'Str', |
28
|
|
|
|
|
|
|
default => 'CPAN', |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has 'conf' => ( |
32
|
|
|
|
|
|
|
is => 'rw', |
33
|
|
|
|
|
|
|
isa => 'Str', |
34
|
|
|
|
|
|
|
required => 1, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has 'always_build' => ( |
38
|
|
|
|
|
|
|
is => 'rw', |
39
|
|
|
|
|
|
|
isa => 'Bool', |
40
|
|
|
|
|
|
|
default => 0, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has 'modulelist' => ( |
44
|
|
|
|
|
|
|
is => 'rw', |
45
|
|
|
|
|
|
|
isa => 'Str', |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
has 'verbose' => ( |
49
|
|
|
|
|
|
|
is => 'rw', |
50
|
|
|
|
|
|
|
isa => 'Bool', |
51
|
|
|
|
|
|
|
default => 0, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub run { |
55
|
0
|
|
|
0
|
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
0
|
|
|
|
unless ( $self->builder eq "Deb" || $self->builder eq "RPM" ) { |
58
|
0
|
|
|
|
|
|
die 'builder option value must be Deb or RPM'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $packager = CPAN::Packager->new( |
62
|
|
|
|
|
|
|
builder => $self->builder, |
63
|
|
|
|
|
|
|
downloader => $self->downloader, |
64
|
|
|
|
|
|
|
conf => $self->conf, |
65
|
|
|
|
|
|
|
always_build => $self->always_build, |
66
|
|
|
|
|
|
|
dry_run => $self->dry_run, |
67
|
|
|
|
|
|
|
verbose => $self->verbose, |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
if ( $self->modulelist ) { |
71
|
0
|
|
|
|
|
|
my $module_list = file( $self->modulelist ); |
72
|
0
|
|
|
|
|
|
my @modules = slurp($module_list, {chomp=>1}); |
73
|
0
|
|
|
|
|
|
@modules = grep { $_ !~ /^#/ } @modules; |
|
0
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
my $built_modules; |
75
|
0
|
|
|
|
|
|
foreach my $module (@modules) { |
76
|
0
|
|
|
|
|
|
$built_modules = $packager->make( $module, $built_modules ); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
else { |
80
|
0
|
0
|
|
|
|
|
die 'module is required' unless $self->module; |
81
|
0
|
|
|
|
|
|
$packager->make( $self->module ); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
1
|
|
6
|
no Mouse; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
86
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |