[libconfig-model-dpkg-perl] 10/33: Tolerate missing debian dir when searching for fix.scanned.copyright

dod at debian.org dod at debian.org
Mon Mar 30 17:41:38 UTC 2015


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

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 68669af97cab680ccb66452c8a90ad00e2000f74
Author: Dominique Dumont <dod at debian.org>
Date:   Thu Mar 26 13:52:09 2015 +0100

    Tolerate missing debian dir when searching for fix.scanned.copyright
---
 lib/Config/Model/Dpkg/Copyright.pm | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/Config/Model/Dpkg/Copyright.pm b/lib/Config/Model/Dpkg/Copyright.pm
index e2df732..fe4a824 100644
--- a/lib/Config/Model/Dpkg/Copyright.pm
+++ b/lib/Config/Model/Dpkg/Copyright.pm
@@ -152,13 +152,17 @@ sub update ($self, %args) {
 
     # read a debian/fix.scanned.copyright file to patch scanned data
     my $current_dir = $args{from_dir} || path('.');
-    my @fixes = $current_dir->child('debian')->children(qr/fix\.scanned\.copyright$/);
-    say "Found @fixes files for copyright fixes" if @fixes;
-    foreach my $fix ( @fixes) {
-        my @l = grep { /[^\s]/ } grep { ! m!^(#|//)!  } $fix->lines_utf8;
-        chomp @l;
-        say "loading: @l";
-        $self->load( "@l" );
+    my $debian = $current_dir->child('debian'); # may be missing in test environment
+    if ($debian->is_dir) {
+        $debian->children(qr/fix\.scanned\.copyright$/);
+        my @fixes = $current_dir->child('debian')->children(qr/fix\.scanned\.copyright$/);
+        say "Found @fixes files for copyright fixes" if @fixes;
+        foreach my $fix ( @fixes) {
+            my @l = grep { /[^\s]/ } grep { ! m!^(#|//)!  } $fix->lines_utf8;
+            chomp @l;
+            say "loading: @l";
+            $self->load( "@l" );
+        }
     }
 
     return ''; # improve returned message ?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



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