[dh-make-perl] 05/07: some refactoring to make discover_utility_deps() easier to understand

gregor herrmann gregoa at debian.org
Thu Oct 1 21:52:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository dh-make-perl.

commit 9be9e8ef6d038943d6f3b88b7cc37dc439616c2a
Author: gregor herrmann <gregoa at debian.org>
Date:   Thu Oct 1 23:27:35 2015 +0200

    some refactoring to make discover_utility_deps() easier to understand
    
    (at least for me)
    
    Gbp-Dch: Ignore
---
 lib/DhMakePerl/Command/Packaging.pm | 39 +++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/lib/DhMakePerl/Command/Packaging.pm b/lib/DhMakePerl/Command/Packaging.pm
index 8492e98..82305bd 100644
--- a/lib/DhMakePerl/Command/Packaging.pm
+++ b/lib/DhMakePerl/Command/Packaging.pm
@@ -1472,46 +1472,49 @@ includes first Module::Build.
 sub discover_utility_deps {
     my ( $self, $control ) = @_;
 
-    my $deps  = $control->source->Build_Depends;
+    my $build_deps        = $control->source->Build_Depends;
+    my $build_deps_indep  = $control->source->Build_Depends_Indep;
+    my $bin_deps          = $control->binary_tie->Values(0)->Depends;
+    my $architecture      = $control->binary_tie->Values(0)->Architecture;
 
     # remove any existing dependencies
-    $deps->remove( 'quilt', 'debhelper' );
+    $build_deps->remove( 'quilt', 'debhelper' );
 
     # start with the minimum
     my $debhelper_version = $self->cfg->dh;
 
-    if ( $control->binary_tie->Values(0)->Architecture eq 'all' ) {
-        $control->source->Build_Depends_Indep->add('perl');
+    if ( $architecture eq 'all' ) {
+        $build_deps_indep->add('perl');
     }
     else {
-        $deps->add('perl');
+        $build_deps->add('perl');
         $debhelper_version = '9.20120312~' if $debhelper_version eq '9';
     }
-    $deps->add( Debian::Dependency->new( 'debhelper', $debhelper_version ) );
+    $build_deps->add( Debian::Dependency->new( 'debhelper', $debhelper_version ) );
 
-    $self->explained_dependency( 'Module::Build::Tiny', $deps,
+    $self->explained_dependency( 'Module::Build::Tiny', $build_deps,
         'debhelper (>= 9.20140227~)' )
-        if $deps->has('libmodule-build-tiny-perl');
+        if $build_deps->has('libmodule-build-tiny-perl');
 
     for ( @{ $self->rules->lines } ) {
         $self->explained_dependency(
             'dh --with=quilt',
-            $deps, 'quilt',
+            $build_deps, 'quilt',
         ) if /dh\s+.*--with[= ]quilt/;
 
         $self->explained_dependency(
             'dh --with=bash-completion',
-            $deps,
+            $build_deps,
             'bash-completion'
         ) if (/dh\s+.*--with[= ]bash[-_]completion/);
 
         $self->explained_dependency(
             'dh --with=perl_dbi',
-            $deps,
+            $build_deps,
             'libdbi-perl'
         ) if (/dh\s+.*--with[= ]perl[-_]dbi/);
 
-        $self->explained_dependency( 'quilt.make', $deps, 'quilt' )
+        $self->explained_dependency( 'quilt.make', $build_deps, 'quilt' )
             if m{^include /usr/share/quilt/quilt.make};
 
     }
@@ -1524,17 +1527,15 @@ sub discover_utility_deps {
     # Remove perl from Build-Depends-Indep as then perl will be already in
     # Build-Depends.
     if ( $self->module_build eq 'Module-Build' ) {
-        $deps->remove('perl (>= 5.10) | libmodule-build-perl');
-        $deps->remove('libmodule-build-perl');
-        $control->source->Build_Depends_Indep->remove('perl');
-        $self->explained_dependency( 'Module::Build', $deps,
+        $build_deps->remove('perl (>= 5.10) | libmodule-build-perl');
+        $build_deps->remove('libmodule-build-perl');
+        $build_deps_indep->remove('perl');
+        $self->explained_dependency( 'Module::Build', $build_deps,
             'perl' );
     }
 
     # some mandatory dependencies
-    my $bin_deps = $control->binary_tie->Values(0)->Depends;
-    $bin_deps += '${shlibs:Depends}'
-        if $self->control->binary_tie->Values(0)->Architecture eq 'any';
+    $bin_deps += '${shlibs:Depends}' if $architecture eq 'any';
     $bin_deps += '${misc:Depends}, ${perl:Depends}';
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/dh-make-perl.git



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