[libconfig-model-dpkg-perl] 16/36: CMD::Copyright: also override directory data with info found in files...

dod at debian.org dod at debian.org
Sat Oct 17 16:27:13 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 80f886967b675e8b650b9936c2ab655a5e2b71b1
Author: Dominique Dumont <dod at debian.org>
Date:   Tue Oct 13 20:35:23 2015 +0200

    CMD::Copyright: also override directory data with info found in files...
    
    ... even when the directory data must be written (path ends with '/*').
    Previously only path ending with '/.' were overridden.
---
 lib/Config/Model/Dpkg/Copyright.pm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/Config/Model/Dpkg/Copyright.pm b/lib/Config/Model/Dpkg/Copyright.pm
index d2a4d9c..afa0ecc 100644
--- a/lib/Config/Model/Dpkg/Copyright.pm
+++ b/lib/Config/Model/Dpkg/Copyright.pm
@@ -132,7 +132,8 @@ sub update ($self, %args) {
     foreach my $p (@packed) {
         my ($id, @paths) = $p->@*;
 
-        if ($paths[0] =~ /\.$/) {
+        # ditch old data when copyright data directory is found in source files
+        if ($paths[0] =~ /[*.]$/) {
             if (@paths > 1) {
                 die "Internal error: can't have dir path with file path: @paths";
             }
@@ -140,8 +141,13 @@ sub update ($self, %args) {
             $p =~ s/\.$/*/;
             my $old_data = delete $preserved_path{$p};
             say "old dir data for $p overridden" if $old_data;
-            next;
+
+            # skip writing data because it duplicates information
+            # found in directory above above (as shown the path ending
+            # with '/.')
+            next if $paths[0] =~ /\.$/;
         };
+
         my $datum = dclone($data[$id]);
         my $path_str = $self->normalize_path(\@paths);
         my $l = $datum->{License}{short_name};

-- 
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