| DhMakePerl documentation | Contained in the DhMakePerl distribution. |
DhMakePerl - create Debian source package from CPAN dist
Version 0.72
use DhMakePerl;
DhMakePerl->run;
Stores the cached copy of Debian::AptContents.
Stores the configuration, an instance of DhMakePerl::Config
Runs DhMakePerl.
Unless the %init contains an cfg member, constructs and instance of DhMakePerl::Config and assigns it to $init{cfg}.
Then determines the dh-make-perl command requested (via cfg->command), loads the appropriate DhMakePerl::Command::$command class, constructs an instance of it and calls its execute method.
Returns (possibly cached) instance of Debian::AptContents.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
| DhMakePerl documentation | Contained in the DhMakePerl distribution. |
package DhMakePerl; use warnings; use strict; use 5.010; # we use smart matching use base 'Class::Accessor'; __PACKAGE__->mk_accessors( qw( cfg apt_contents ) );
our $VERSION = '0.72';
use Debian::AptContents (); use DhMakePerl::Config; use version ();
sub run { my ( $class, %c ) = @_; unless ( $c{cfg} ) { my $cfg = DhMakePerl::Config->new; $cfg->parse_command_line_options; $cfg->parse_config_file; $c{cfg} = $cfg; } my $cmd_mod = $c{cfg}->command; $cmd_mod =~ s/-/_/g; require "DhMakePerl/Command/$cmd_mod.pm"; $cmd_mod =~ s{/}{::}g; $cmd_mod = "DhMakePerl::Command::$cmd_mod"; my $self = $cmd_mod->new( \%c ); return $self->execute; }
sub get_apt_contents { my $self = shift; return $self->apt_contents if $self->apt_contents; my $apt_c = Debian::AptContents->new( { homedir => $self->cfg->home_dir, dist => $self->cfg->dist, sources => $self->cfg->sources_list, verbose => $self->cfg->verbose, contents_dir => $self->cfg->apt_contents_dir, } ); undef $apt_c unless $apt_c->cache; return $self->apt_contents($apt_c); }
1; # End of DhMakePerl