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 cf3a1619948cfdded0c83ff8eb11f26c04ced172
Author: Dominique Dumont <d...@debian.org>
Date:   Sat Apr 25 17:49:51 2015 +0200

    Copyright scanner: take care of ranges written like 2014-15
---
 lib/Dpkg/Copyright/Scanner.pm | 7 ++++++-
 t/scanner/pack_copyright.t    | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/Dpkg/Copyright/Scanner.pm b/lib/Dpkg/Copyright/Scanner.pm
index ae5b70f..305bcef 100644
--- a/lib/Dpkg/Copyright/Scanner.pm
+++ b/lib/Dpkg/Copyright/Scanner.pm
@@ -183,7 +183,12 @@ sub __pack_copyright ($r) {
         my $data = $cop{$owner};
         foreach my $year ($data->@*) {
             return $r if $year =~ /[^\d-]/; # bail-out
-            $span->set_range_as_string($year, $owner);
+            # take care of ranges written like 2014-15
+            $year =~ s/^(\d\d)(\d\d)-(\d\d)$/$1$2-$1$3/;
+            eval {
+                $span->set_range_as_string($year, $owner);
+            };
+            return $r if $@; # invalid range
         }
         $span->consolidate();
         push @res, $span->get_range_list. ', '. $owner;
diff --git a/t/scanner/pack_copyright.t b/t/scanner/pack_copyright.t
index 7b19410..4415523 100644
--- a/t/scanner/pack_copyright.t
+++ b/t/scanner/pack_copyright.t
@@ -11,7 +11,7 @@ require_ok( 'Dpkg::Copyright::Scanner' );
 
 my @tests = (
     [
-        '2002-2006 Charles Kerr <char...@rebelbase.com>',
+        '2002-06 Charles Kerr <char...@rebelbase.com>',
         '2002-2006, Charles Kerr <char...@rebelbase.com>'
     ],
     [

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

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to