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

[lintian] 03/05: warn if pipe symbol is used as an OR in dep-5 license



This is an automated email from the git hooks/post-receive script.

broucaries-guest pushed a commit to branch master
in repository lintian.

commit 7e2b7a0934cdb8c8ce4194d45012c98b20e58b3c
Author: Johannes Schauer <j.schauer@email.de>
Date:   Mon Aug 11 09:13:04 2014 +0200

    warn if pipe symbol is used as an OR in dep-5 license
    
    commas have a special meaning in the License field of a DEP-5 copyright
    file. In front of an "and" they signal that the preceding "or" has
    priority. Other uses of it are most likely illegal. Examples:
    
    License: Apache Software License, Version 1.1
    http://sources.debian.net/src/jxplorer/3.3.2+dfsg-2/debian/copyright?hl=40#L40
    
    License: Boost Software License, Version 1.0
    http://sources.debian.net/src/yade/1.10.0-1/debian/copyright?hl=47#L47
    
    License: commercial or GPL-2.0 or GPL-3.0, with the following exception:
    http://sources.debian.net/src/libqglviewer/2.5.2+dfsg-1/debian/copyright?hl=12#L12
    
    License: For terms of use, see http://www.unicode.org/terms_of_use.html
    http://sources.debian.net/src/libidn2-0/0.10-1/debian/copyright/?hl=112#L112
    
    License: GPL-2 or MIT, according to http://benalman.com/about/license/
    http://sources.debian.net/src/trac-codecomments/1.1.1%2Bdfsg-1/debian/copyright/?hl=41#L41
    
    License: SGI Free Software License B, Version 1.1
    http://sources.debian.net/src/psychtoolbox-3/3.0.11.20140430.dfsg1-1/debian/copyright/?hl=212#L212
    
    License: SIL Open Font License, Version 1.1 – 26 February 2007
    http://sources.debian.net/src/fonts-senamirmir-washra/4.1-9/debian/copyright/?hl=22#L22
    
    License: SIL Open Font License, Version 1.1 (http://scripts.sil.org/OFL)
    http://sources.debian.net/src/widelands/1:18-3/debian/copyright/?hl=27#L27
---
 checks/source-copyright.desc                             |  9 +++++++++
 checks/source-copyright.pm                               |  8 ++++++++
 .../debian/debian/copyright                              | 16 ++++++++++++++++
 t/tests/source-copyright-illegal-pipe-as-or/desc         |  6 ++++++
 t/tests/source-copyright-illegal-pipe-as-or/tags         |  2 ++
 5 files changed, 41 insertions(+)

diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index 921e7b9..bca74cc 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -205,3 +205,12 @@ Info: The paragraph has a "License" and a "Copyright" field, but no
  Lintian will attempt to guess what you intended and continue based on
  its guess.  If the guess is wrong, you may see spurious tags related
  to this paragraph.
+
+Tag: pipe-symbol-used-as-license-disjunction
+Severity: normal
+Certainty: possible
+Ref: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Info: In contrast to package dependencies, the pipe symbol or vertical
+ bar does not indicate a logical disjunction or OR-relationship
+ between two license short names. Instead, the keyword "or" between
+ two license names indicates the dual licensing.
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 6b9a0c5..e99ea02 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -277,6 +277,10 @@ sub _parse_dep5 {
             my ($found_license, $full_license, $short_license, @short_licenses)
               = parse_license($license,$current_line);
             # Standalone license paragraph
+            if (defined($short_license) and $short_license =~ /\s++\|\s++/) {
+                tag 'pipe-symbol-used-as-license-disjunction', $short_license,
+                  "(paragraph at line $current_line)";
+            }
             if(not defined($full_license)) {
                 tag 'missing-license-text-in-dep5-copyright', $license,
                   "(paragraph at line $current_line)";
@@ -299,6 +303,10 @@ sub _parse_dep5 {
 
             my ($found_license, $full_license, $short_license, @short_licenses)
               = parse_license($license,$current_line);
+            if (defined($short_license) and $short_license =~ /\s++\|\s++/) {
+                tag 'pipe-symbol-used-as-license-disjunction', $short_license,
+                  "(paragraph at line $current_line)";
+            }
             if ($found_license) {
                 for (@short_licenses) {
                     $short_licenses_seen{$short_license} = $i;
diff --git a/t/tests/source-copyright-illegal-pipe-as-or/debian/debian/copyright b/t/tests/source-copyright-illegal-pipe-as-or/debian/debian/copyright
new file mode 100644
index 0000000..acbd7b3
--- /dev/null
+++ b/t/tests/source-copyright-illegal-pipe-as-or/debian/debian/copyright
@@ -0,0 +1,16 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Doohickey
+Upstream-Contact: J. Random Hacker <j.r.hacker@example.com>
+Source: http://examples.com/doohickey/source/
+
+Files: *
+Copyright: 2014, somebody1
+License: this | that
+
+Files: debian/*
+Copyright: 2014, somebody1
+License: this|that
+ this is a valid license short name
+
+License: this | that
+ should be "this or that"
diff --git a/t/tests/source-copyright-illegal-pipe-as-or/desc b/t/tests/source-copyright-illegal-pipe-as-or/desc
new file mode 100644
index 0000000..43669d1
--- /dev/null
+++ b/t/tests/source-copyright-illegal-pipe-as-or/desc
@@ -0,0 +1,6 @@
+Testname: source-copyright-illegal-pipe-as-or
+Sequence: 6000
+Version: 1.0
+Description: Test for the pipe symbol being used as an "or"
+Test-For:
+ pipe-symbol-used-as-license-disjunction
diff --git a/t/tests/source-copyright-illegal-pipe-as-or/tags b/t/tests/source-copyright-illegal-pipe-as-or/tags
new file mode 100644
index 0000000..cace0c7
--- /dev/null
+++ b/t/tests/source-copyright-illegal-pipe-as-or/tags
@@ -0,0 +1,2 @@
+W: source-copyright-illegal-pipe-as-or source: pipe-symbol-used-as-license-disjunction this | that (paragraph at line 15)
+W: source-copyright-illegal-pipe-as-or source: pipe-symbol-used-as-license-disjunction this | that (paragraph at line 6)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: