r53437 - in /trunk/dh-make-perl/lib: DhMakePerl.pm DhMakePerl/Command/ DhMakePerl/Command/refresh_cache.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sun Feb 28 22:14:17 UTC 2010


Author: dmn
Date: Sun Feb 28 22:14:06 2010
New Revision: 53437

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53437
Log:
separate refresh-cache command in its own module

Added:
    trunk/dh-make-perl/lib/DhMakePerl/Command/
    trunk/dh-make-perl/lib/DhMakePerl/Command/refresh_cache.pm
Modified:
    trunk/dh-make-perl/lib/DhMakePerl.pm

Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=53437&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Sun Feb 28 22:14:06 2010
@@ -180,9 +180,11 @@
     die "CPANPLUS support disabled, sorry" if $self->cfg->cpanplus;
 
     if ( $self->cfg->command eq 'refresh-cache' ) {
-        $self->get_apt_contents;
-
-        return 0;
+        my $cmd_mod = $self->cfg->command;
+        $cmd_mod =~ s/-/_/g;
+        require "DhMakePerl/Command/$cmd_mod.pm";
+        bless $self, "DhMakePerl::Command::$cmd_mod";
+        return $self->execute;
     }
 
     if ( $self->cfg->command eq 'dump-config' ) {

Added: trunk/dh-make-perl/lib/DhMakePerl/Command/refresh_cache.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/refresh_cache.pm?rev=53437&op=file
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/refresh_cache.pm (added)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/refresh_cache.pm Sun Feb 28 22:14:06 2010
@@ -1,0 +1,63 @@
+package DhMakePerl::Command::refresh_cache;
+
+=head1 NAME
+
+DhMakePerl::Command::refresh_cache - dh-make-perl refresh-cache implementation
+
+=head1 DESCRIPTION
+
+This module implements the I<refresh-cache> command of L<dh-make-perl(1)>.
+
+=cut
+
+use strict; use warnings;
+
+use base 'DhMakePerl';
+
+=head1 METHODS
+
+=over
+
+=item execute
+
+Provides I<refresh-cache> command implementation.
+
+=cut
+
+sub execute {
+    my $self = shift;
+
+    $self->get_apt_contents;
+
+    return 0;
+}
+
+=back
+
+=cut
+
+1;
+
+=head1 COPYRIGHT & LICENSE
+
+=over
+
+=item Copyright (C) 2010 Damyan Ivanov <dmn at debian.org>
+
+
+=back
+
+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.
+
+=cut
+




More information about the Pkg-perl-cvs-commits mailing list