[SCM] Debian packaging of dh-make-perl branch, master, updated. debian/0.75-1-25-gb44b9a6

Damyan Ivanov dmn at debian.org
Tue Sep 11 18:33:46 UTC 2012


The following commit has been merged in the master branch:
commit dd402f2b616645ab0e6b19320f9a88122e4f3753
Author: Damyan Ivanov <dmn at debian.org>
Date:   Tue Sep 11 21:31:56 2012 +0300

    D:C:FromCPAN/find_debs_for_modules: search core first
    
    otherwise we get 'perl-modules (>= 2.21)' when requiring
    ExtUtils::ParseXS 2.21
    
    The proper fix is probably to look in core *and* the installed
    packages/apt and create an alternative dependency if
    multiple matches are found. that would work even for
    dependencies that would otherwise require blead

diff --git a/lib/Debian/Control/FromCPAN.pm b/lib/Debian/Control/FromCPAN.pm
index 2a5f03d..4f3a905 100644
--- a/lib/Debian/Control/FromCPAN.pm
+++ b/lib/Debian/Control/FromCPAN.pm
@@ -248,8 +248,9 @@ EOF
 
 Scans the given hash of dependencies ( module => version ) and returns
 matching Debian package dependency specification (as an instance of
-L<Debian::Dependencies> class) and a list of missing modules. Installed
-packages are searched first, then the APT contents, then the perl core.
+L<Debian::Dependencies> class) and a list of missing modules.
+
+Perl core is searched first, then installed packages, then the APT contents.
 
 =cut
 
@@ -272,7 +273,10 @@ sub find_debs_for_modules {
         my $dep;
 
         require Debian::DpkgLists;
-        if ( my @pkgs = Debian::DpkgLists->scan_perl_mod($module) ) {
+        if ( my $ver = is_core_module( $module, $version ) ) {
+            $dep = Debian::Dependency->new( 'perl', $ver );
+        }
+        elsif ( my @pkgs = Debian::DpkgLists->scan_perl_mod($module) ) {
             $dep = Debian::Dependency->new(
                   ( @pkgs > 1 )
                 ? [ map { { pkg => $_, ver => $version } } @pkgs ]
@@ -282,9 +286,6 @@ sub find_debs_for_modules {
         elsif ($apt_contents) {
             $dep = $apt_contents->find_perl_module_package( $module, $version );
         }
-        elsif ( my $ver = is_core_module( $module, $version ) ) {
-            $dep = Debian::Dependency->new( 'perl', $ver );
-        }
 
 
         $dep->rel($ver_rel) if $dep and $ver_rel and $dep->ver;
diff --git a/t/perl-deps.t b/t/perl-deps.t
index 4c5b2b8..f16e841 100755
--- a/t/perl-deps.t
+++ b/t/perl-deps.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 11;
+use Test::More tests => 12;
 use Test::Exception;
 
 BEGIN {
@@ -47,3 +47,9 @@ is( $ctl->prune_perl_dep( $dep->new('perl (= 5.10.0)') ) . '',
     'perl (= 5.10.0)',
     'perl =5.10.0 is left intact'
 );
+
+is( ( $ctl->find_debs_for_modules( { 'ExtUtils::ParseXS' => '2.21' } ) )[0]
+        . '',
+    'perl (>= 5.11.1)',
+    'ExtUtils::ParseXS 2.21 is in perl 5.11.1'
+);

-- 
Debian packaging of dh-make-perl



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