[PATCH] dpkg copyright: Handle comma in license (Closes: #624305)

Niko Tyni ntyni at debian.org
Wed Apr 27 18:43:56 UTC 2011


Quoting DEP-5:
 For the most complex cases, the comma is used to disambiguate the
 priority of ors and ands: and has the priority over or, unless preceded
 by a comma.
---
 .../Model/models/Debian/Dpkg/Copyright/License.pl  |    3 ++-
 t/copyright-examples/t13                           |    7 +++++++
 t/debian-dpkg-copyright.t                          |    5 ++++-
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 t/copyright-examples/t13

diff --git a/lib/Config/Model/models/Debian/Dpkg/Copyright/License.pl b/lib/Config/Model/models/Debian/Dpkg/Copyright/License.pl
index e26247d..5a2d47f 100644
--- a/lib/Config/Model/models/Debian/Dpkg/Copyright/License.pl
+++ b/lib/Config/Model/models/Debian/Dpkg/Copyright/License.pl
@@ -23,7 +23,8 @@
         'value_type' => 'uniline',
         'grammar' => 'check: <rulevar: local $found = 0> <rulevar: local $ok = 1 >
 check: license alternate(s?) <reject: $text or not $found or not $ok >
-alternate: oper license 
+alternate: comma(?) oper license 
+comma: \',\'
 oper: \'and\' | \'or\' 
 license: /[\\w\\-\\.\\+]+/i
    { # PRD action to check if the license text is provided
diff --git a/t/copyright-examples/t13 b/t/copyright-examples/t13
new file mode 100644
index 0000000..ceadf15
--- /dev/null
+++ b/t/copyright-examples/t13
@@ -0,0 +1,7 @@
+Format: http://www.debian.org/doc/copyright-format/1.0
+
+Files: *
+Copyright: none
+License: GPL-2+ or Artistic-2.0, and BSD
+ This is for a file that has Perl code and classic BSD code in it.
+
diff --git a/t/debian-dpkg-copyright.t b/t/debian-dpkg-copyright.t
index ace21ea..a1e7b29 100644
--- a/t/debian-dpkg-copyright.t
+++ b/t/debian-dpkg-copyright.t
@@ -18,7 +18,7 @@ if ( $@ ) {
     plan skip_all => "AptPkg::Config is not installed (not a Debian system ?)";
 }
 else {
-    plan tests => 163;
+    plan tests => 172;
 }
 
 my $arg = shift ;
@@ -190,6 +190,9 @@ my @tests = (
         errors =>  [ 
             qr/not declared/ => 'License:Expat="Expat license foobar"',
         ],
+    },
+
+    { # t13 Debian bug #624305
    }
 );
 
-- 
1.7.4.4


--Dxnq1zWXvFF0Q93v--





More information about the pkg-perl-maintainers mailing list