[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.2.6-17-gae9fa2e



The following commit has been merged in the master branch:
commit 8c51e85bb60b999c65e873eb5cd21b4855a4a7c7
Author: Russ Allbery <rra@debian.org>
Date:   Sat Feb 28 21:14:23 2009 -0800

    Issue the right tag for license references without the hyphen
    
    * checks/copyright-file{,.desc}:
      + [RA] Avoid false positive for versionless license files when the
        file is referred to without a hyphen; instead, issue a separate tag
        that explains the problem.  Based on a patch from Raphael Geissert.

diff --git a/checks/copyright-file b/checks/copyright-file
index a8e83ea..6855164 100644
--- a/checks/copyright-file
+++ b/checks/copyright-file
@@ -152,11 +152,13 @@ if (m,(usr/share/common-licenses/(?:GPL|LGPL|BSD|Artistic)\.gz),) {
 # Allow generic GPL references for packages licensed under the same terms as
 # Perl for now.  Perl references GPL version 1, which isn't in
 # common-licenses.
-if (m,(usr/share/common-licenses/(L?GPL|GFDL))[^-],i && !m,as Perl itself,i
+if (m,(usr/share/common-licenses/(L?GPL|GFDL))([^-]),i && !m,as Perl itself,i
     && !m,License-Alias:\s+Perl,) {
-    my $ref = $1;
-    my $license = $2;
-    if (m,\b(?:any|or)\s+later(?:\s+version)?\b,i || m,License: $license-[\d\.]+\+,i) {
+    my ($ref, $license, $separator) = ($1, $2, $3);
+    if ($separator =~ /[\d\w]/) {
+	tag 'copyright-refers-to-nonexistent-license-file', "$ref$separator";
+    } elsif (m,\b(?:any|or)\s+later(?:\s+version)?\b,i
+	     || m,License: $license-[\d\.]+\+,i) {
 	tag "copyright-refers-to-symlink-license", $ref;
     } else {
 	tag "copyright-refers-to-versionless-license-file", $ref;
diff --git a/checks/copyright-file.desc b/checks/copyright-file.desc
index 221a110..2b05fd1 100644
--- a/checks/copyright-file.desc
+++ b/checks/copyright-file.desc
@@ -357,3 +357,11 @@ Info: The copyright file refers to the versionless symlink in
  published by the Free Software Foundation; version 2 dated June, 1991,"
  the <tt>debian/copyright</tt> file should refer to
  <tt>/usr/share/common-licenses/GPL-2</tt>, not <tt>/GPL</tt>.
+
+Tag: copyright-refers-to-nonexistent-license-file
+Severity: normal
+Certainty: certain
+Info: The copyright file refers to a license in
+ <tt>/usr/share/common-licenses</tt> that doesn't exist.  Usually this is
+ a typo, such as accidentally omitting the <tt>-</tt> between the license
+ name and the version number.
diff --git a/debian/changelog b/debian/changelog
index 32cdfe6..8feda97 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ lintian (2.2.7) UNRELEASED; urgency=low
 
   * Summary of tag changes:
     + Added
+      - copyright-refers-to-nonexistent-license-file
       - embedded-zlib
 
   * checks/binaries{,.desc}:
@@ -13,9 +14,12 @@ lintian (2.2.7) UNRELEASED; urgency=low
   * checks/changelog-file:
     + [RA] Avoid capturing parentheses in regexes due to their minor
       performance penalty.  Patch from Raphael Geissert.
-  * checks/copyright-file:
+  * checks/copyright-file{,.desc}:
     + [RA] Avoid capturing parentheses in regexes due to their minor
       performance penalty.  Patch from Raphael Geissert.
+    + [RA] Avoid false positive for versionless license files when the
+      file is referred to without a hyphen; instead, issue a separate tag
+      that explains the problem.  Based on a patch from Raphael Geissert.
   * checks/fields:
     + [RA] Precompile constant regexes with qr.  Patch from Raphael
       Geissert.
diff --git a/t/tests/copyright-file-general/debian/debian/copyright-misc-errors.copyright b/t/tests/copyright-file-general/debian/debian/copyright-misc-errors.copyright
index c434ac0..a39846e 100644
--- a/t/tests/copyright-file-general/debian/debian/copyright-misc-errors.copyright
+++ b/t/tests/copyright-file-general/debian/debian/copyright-misc-errors.copyright
@@ -13,6 +13,8 @@ It's wrong to reference a compressed license, like this:
 
 This path /usr/share/doc/copyright is obsolete.
 
+The path /usr/share/common-licenses/GPL2 is missing a hyphen.
+
 This copyright info was automatically extracted from the perl module.
 It may not be accurate, so you better check the module sources
 if you don't want to get into legal troubles.
diff --git a/t/tests/copyright-file-general/desc b/t/tests/copyright-file-general/desc
index add85ac..88c862c 100644
--- a/t/tests/copyright-file-general/desc
+++ b/t/tests/copyright-file-general/desc
@@ -15,6 +15,7 @@ Test-For:
  copyright-refers-to-bad-php-license
  copyright-refers-to-compressed-license
  copyright-refers-to-incorrect-directory
+ copyright-refers-to-nonexistent-license-file
  copyright-refers-to-old-directory
  copyright-refers-to-problematic-php-license
  copyright-should-refer-to-common-license-file-for-gfdl
diff --git a/t/tests/copyright-file-general/tags b/t/tests/copyright-file-general/tags
index 12241d2..c916bd7 100644
--- a/t/tests/copyright-file-general/tags
+++ b/t/tests/copyright-file-general/tags
@@ -18,4 +18,5 @@ W: copyright-iso-8859-1: debian-copyright-file-uses-obsolete-national-encoding a
 W: copyright-misc-errors: copyright-contains-dh-make-perl-boilerplate
 W: copyright-misc-errors: copyright-has-url-from-dh_make-boilerplate
 W: copyright-misc-errors: copyright-lists-upstream-authors-with-dh_make-boilerplate
+W: copyright-misc-errors: copyright-refers-to-nonexistent-license-file usr/share/common-licenses/GPL2
 W: copyright-old-style: copyright-without-copyright-notice

-- 
Debian package checker


Reply to: