| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package DhMakePerl; |
|
2
|
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
27803
|
use warnings; |
|
|
11
|
|
|
|
|
119
|
|
|
|
11
|
|
|
|
|
566
|
|
|
4
|
11
|
|
|
11
|
|
79
|
use strict; |
|
|
11
|
|
|
|
|
51
|
|
|
|
11
|
|
|
|
|
368
|
|
|
5
|
11
|
|
|
11
|
|
814
|
use 5.010; # we use smart matching |
|
|
11
|
|
|
|
|
54
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
75
|
use base 'Class::Accessor'; |
|
|
11
|
|
|
|
|
44
|
|
|
|
11
|
|
|
|
|
12292
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( cfg apt_contents ) ); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
DhMakePerl - create Debian source package from CPAN dist |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 VERSION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Version 0.89 |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '0.89'; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use DhMakePerl; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
DhMakePerl->run; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 ACCESSORS |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=over |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item apt_contents |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Stores the cached copy of L. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item cfg |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Stores the configuration, an instance of L |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=back |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 CLASS METHODS |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=over |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
|
48
|
|
|
|
|
|
|
|
|
49
|
11
|
|
|
11
|
|
41412
|
use Debian::AptContents (); |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use DhMakePerl::Config; |
|
51
|
|
|
|
|
|
|
use version (); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item run( I<%init> ) |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Runs DhMakePerl. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Unless the %init contains an I member, constructs and instance of |
|
58
|
|
|
|
|
|
|
L and assigns it to I<$init{cfg}>. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Then determines the dh-make-perl command requested (via cfg->command), loads |
|
61
|
|
|
|
|
|
|
the appropriate I class, constructs an instance |
|
62
|
|
|
|
|
|
|
of it and calls its I method. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub run { |
|
67
|
|
|
|
|
|
|
my ( $class, %c ) = @_; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
unless ( $c{cfg} ) { |
|
70
|
|
|
|
|
|
|
my $cfg = DhMakePerl::Config->new; |
|
71
|
|
|
|
|
|
|
$cfg->parse_command_line_options; |
|
72
|
|
|
|
|
|
|
$cfg->parse_config_file; |
|
73
|
|
|
|
|
|
|
$c{cfg} = $cfg; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my $cmd_mod = $c{cfg}->command; |
|
77
|
|
|
|
|
|
|
$cmd_mod =~ s/-/_/g; |
|
78
|
|
|
|
|
|
|
require "DhMakePerl/Command/$cmd_mod.pm"; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$cmd_mod =~ s{/}{::}g; |
|
81
|
|
|
|
|
|
|
$cmd_mod = "DhMakePerl::Command::$cmd_mod"; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my $self = $cmd_mod->new( \%c ); |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
return $self->execute; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item get_apt_contents |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Returns (possibly cached) instance of L. |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub get_apt_contents { |
|
95
|
|
|
|
|
|
|
my $self = shift; |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
return $self->apt_contents |
|
98
|
|
|
|
|
|
|
if $self->apt_contents; |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $apt_c = Debian::AptContents->new( |
|
101
|
|
|
|
|
|
|
{ homedir => $self->cfg->home_dir, |
|
102
|
|
|
|
|
|
|
dist => $self->cfg->dist, |
|
103
|
|
|
|
|
|
|
sources => $self->cfg->sources_list, |
|
104
|
|
|
|
|
|
|
verbose => $self->cfg->verbose, |
|
105
|
|
|
|
|
|
|
contents_dir => $self->cfg->apt_contents_dir, |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
undef $apt_c unless $apt_c->cache; |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
return $self->apt_contents($apt_c); |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=back |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=over |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item Copyright (C) 2009, 2010 Damyan Ivanov |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=back |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under |
|
125
|
|
|
|
|
|
|
the terms of the GNU General Public License version 2 as published by the Free |
|
126
|
|
|
|
|
|
|
Software Foundation. |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY |
|
129
|
|
|
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
|
130
|
|
|
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with |
|
133
|
|
|
|
|
|
|
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin |
|
134
|
|
|
|
|
|
|
Street, Fifth Floor, Boston, MA 02110-1301 USA. |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=cut |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
1; # End of DhMakePerl |