r29501 - /trunk/dh-make-perl/lib/DhMakePerl/Config.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri Jan 9 20:30:13 UTC 2009


Author: dmn
Date: Fri Jan  9 20:30:09 2009
New Revision: 29501

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29501
Log:
Config: actually support cpan2deb

detect cpan2deb mode and store it in Config accessor. In that mode,
require single non-option argument and assign it to --cpan

Modified:
    trunk/dh-make-perl/lib/DhMakePerl/Config.pm

Modified: trunk/dh-make-perl/lib/DhMakePerl/Config.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Config.pm?rev=29501&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Config.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Config.pm Fri Jan  9 20:30:09 2009
@@ -36,6 +36,7 @@
         @opts;
     },
     'command',
+    'cpan2deb',
     '_explicitly_set',
 );
 
@@ -68,12 +69,15 @@
     my $class = shift;
     my $values = shift || {};
 
+    my $cpan2deb = basename($0) eq 'cpan2deb';
+
     my $self = $class->SUPER::new(
         {   %{ $class->DEFAULTS },
-            (   ( basename($0) eq 'cpan2deb' )
+            (   $cpan2deb
                 ? %{ $class->cpan2deb_DEFAULTS }
                 : ()
             ),
+            cpan2deb    => $cpan2deb,
             @_,
         },
     );
@@ -127,6 +131,12 @@
     }
 
     $self->command( ( keys %opts )[0] );
+
+    if ($self->cpan2deb) {
+        @ARGV == 1 or die "cpan2deb requires exactly one non-option argument";
+
+        $self->cpan( shift @ARGV );
+    }
 }
 
 sub parse_config_file {




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