r55211 - in /trunk/dh-make-perl/lib/DhMakePerl: Command/Packaging.pm Command/make.pm Utils.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Wed Mar 31 05:59:02 UTC 2010


Author: dmn
Date: Wed Mar 31 05:58:54 2010
New Revision: 55211

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55211
Log:
move configure_cpan to Packaging and call it in discover_dependencies()

d_d() uses Utils' find_cpan_module which needs a configured CPAN

Modified:
    trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm
    trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
    trunk/dh-make-perl/lib/DhMakePerl/Utils.pm

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm?rev=55211&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/Packaging.pm Wed Mar 31 05:58:54 2010
@@ -1056,6 +1056,32 @@
     warn sprintf( "%s needs %s\n", $reason, join( ', ', @to_add ) );
 }
 
+=item configure_cpan
+
+Configure CPAN module. It is safe to call this method more than once, it will
+do nothing if CPAN is already configured.
+
+=cut
+
+sub configure_cpan {
+    my $self = shift;
+
+    return if $CPAN::Config_loaded;
+
+    CPAN::Config->load( be_silent => not $self->cfg->verbose );
+
+    unshift( @{ $CPAN::Config->{'urllist'} }, $self->cfg->cpan_mirror )
+        if $self->cfg->cpan_mirror;
+
+    $CPAN::Config->{'build_dir'}         = $ENV{'HOME'} . "/.cpan/build";
+    $CPAN::Config->{'cpan_home'}         = $ENV{'HOME'} . "/.cpan/";
+    $CPAN::Config->{'histfile'}          = $ENV{'HOME'} . "/.cpan/history";
+    $CPAN::Config->{'keep_source_where'} = $ENV{'HOME'} . "/.cpan/source";
+    $CPAN::Config->{'tar_verbosity'}     = $self->cfg->verbose ? 'v' : '';
+    $CPAN::Config->{'load_module_verbosity'}
+        = $self->cfg->verbose ? 'verbose' : 'silent';
+}
+
 =item discover_dependencies
 
 Just a wrapper around $self->control->discover_dependencies which provides the
@@ -1072,6 +1098,9 @@
             = Debian::WNPP::Query->new(
             { cache_file => catfile( $self->cfg->home_dir, 'wnpp.cache' ) } )
             if $self->cfg->network;
+
+        # control->discover_dependencies needs configured CPAN
+        $self->cofigure_cpan;
 
         $self->control->discover_dependencies(
             {   dir          => $self->main_dir,

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm?rev=55211&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm Wed Mar 31 05:58:54 2010
@@ -184,32 +184,6 @@
     return(0);
 }
 
-=item configure_cpan
-
-Configure CPAN module. It is safe to call this method more than once, it will
-do nothing if CPAN is already configured.
-
-=cut
-
-sub configure_cpan {
-    my $self = shift;
-
-    return if $CPAN::Config_loaded;
-
-    CPAN::Config->load( be_silent => not $self->cfg->verbose );
-
-    unshift( @{ $CPAN::Config->{'urllist'} }, $self->cfg->cpan_mirror )
-        if $self->cfg->cpan_mirror;
-
-    $CPAN::Config->{'build_dir'}         = $ENV{'HOME'} . "/.cpan/build";
-    $CPAN::Config->{'cpan_home'}         = $ENV{'HOME'} . "/.cpan/";
-    $CPAN::Config->{'histfile'}          = $ENV{'HOME'} . "/.cpan/history";
-    $CPAN::Config->{'keep_source_where'} = $ENV{'HOME'} . "/.cpan/source";
-    $CPAN::Config->{'tar_verbosity'}     = $self->cfg->verbose ? 'v' : '';
-    $CPAN::Config->{'load_module_verbosity'}
-        = $self->cfg->verbose ? 'verbose' : 'silent';
-}
-
 sub setup_dir {
     my ($self) = @_;
 

Modified: trunk/dh-make-perl/lib/DhMakePerl/Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Utils.pm?rev=55211&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Utils.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Utils.pm Wed Mar 31 05:58:54 2010
@@ -28,6 +28,9 @@
 
 Returns CPAN::Module object that corresponds to the supplied argument. Returns
 undef if no module is found by CPAN.
+
+If CPAN module needs to be configured in some way, that should be done before
+calling this function.
 
 =cut
 




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