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 1fd04a507bc02b8ed4def57b93416317e37fc945
Author: Dominique Dumont <d...@debian.org>
Date:   Fri May 8 18:45:00 2015 +0200

    scanner: provide better error message for invalid (c) year ranges
---
 lib/Dpkg/Copyright/Scanner.pm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/Dpkg/Copyright/Scanner.pm b/lib/Dpkg/Copyright/Scanner.pm
index 1685e80..b7cfe29 100644
--- a/lib/Dpkg/Copyright/Scanner.pm
+++ b/lib/Dpkg/Copyright/Scanner.pm
@@ -199,7 +199,10 @@ sub __pack_copyright ($r) {
             eval {
                 $span->set_range_as_string($year, $owner);
             };
-            return $r if $@; # invalid range
+            if ($@) {
+                say "Invalid year range in copyright: $r";
+                return $r;
+            }
         }
         $span->consolidate();
         push @res, $span->get_range_list. ', '. $owner;
@@ -313,7 +316,13 @@ sub __coalesce_copyright_years($entries, $owners) {
             return () if $years[$i] =~ /[^\d,\s-]/;
             my $span = $ranges_of_years[$i] //= Array::IntSpan->new();
             return () unless $span; # bail out in case of problems
-            $span->set_range_as_string($years[$i], 1);
+            eval {
+                $span->set_range_as_string($years[$i], 1);
+            };
+            if ($@) {
+                say "Invalid year range: ",$years[$i];
+                return ();
+            }
         }
     }
 

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