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

[lintian] 01/01: Warn when a "Files: *" DEP-5 paragraph exists but it is not the first paragraph. Thank to Christoph Biedl for the report and idea. (Closes: #879235)



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

lamby pushed a commit to branch master
in repository lintian.

commit 54c3b0095bd3444bfa756671c0833685abfa71df
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Jan 28 14:26:03 2018 +1100

    Warn when a "Files: *" DEP-5 paragraph exists but it is not the first paragraph. Thank to Christoph Biedl for the report and idea. (Closes: #879235)
---
 checks/source-copyright.desc                       | 16 +++++++++++++
 checks/source-copyright.pm                         |  4 ++++
 debian/changelog                                   |  3 +++
 .../debian/debian/copyright                        | 28 ++++++++++++++++++++++
 .../debian/filea                                   |  0
 .../desc                                           |  6 +++++
 .../tags                                           |  1 +
 7 files changed, 58 insertions(+)

diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index 264e07c..be2b013 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -374,3 +374,19 @@ Info: The <tt>Files-Excluded</tt> field in <tt>debian/copyright</tt> is
  .
    Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Ref: uscan(1)
+
+Tag: global-files-wildcard-not-first-paragraph-in-dep5-copyright
+Severity: normal
+Certainty: possible
+Info: The specified paragraph in the machine readable copyright file references
+ all possible files but is not the first paragraph. For example:
+ .
+  Files: filea
+  Copyright: 2009, ...
+ .
+  Files: *
+  Copyright: 2010, ...
+ .
+ As the paragraphs is matched on a "last match wins" principle, all proceeding
+ paragraphs are overridden.
+Ref: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 5c31247..1432e2c 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -348,6 +348,10 @@ sub _parse_dep5 {
                   "paragraph at line $current_line)";
             }
 
+            tag 'global-files-wildcard-not-first-paragraph-in-dep5-copyright',
+              "(paragraph at line $current_line)"
+              if $files eq '*' and $i > 1;
+
             # Files paragraph
             if (not @commas_in_files and $files =~ /,/) {
                 @commas_in_files = ($i, $files_fname);
diff --git a/debian/changelog b/debian/changelog
index 623446c..610064d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ lintian (2.5.73) UNRELEASED; urgency=medium
     + [CL] Warn about packages that specify a Files-Excluded header without
       a valid Format header as the former will be ignored by uscan(1).
       Thanks to Gunnar Wolf for the initial patch.  (Closes: #745743)
+    + [CL] Warn when a "Files: *" DEP-5 paragraph exists but it is not the
+      first paragraph. Thank to Christoph Biedl for the report and idea.
+      (Closes: #879235)
   * checks/cruft.pm:
     + [CL] When looking for the source of "build/foo/bar.min.js", also
       check "src/foo/bar.js".  (Closes: #832027)
diff --git a/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/debian/debian/copyright b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/debian/debian/copyright
new file mode 100644
index 0000000..b8340bc
--- /dev/null
+++ b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/debian/debian/copyright
@@ -0,0 +1,28 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: lintian
+Upstream-Contact: Lintian Maintainers <debian-lint-maint@lists.debian.org>
+Source: http://git.debian.org/?p=lintian/lintian.git
+
+Files: filea
+Copyright: 2011 J. Random Hacker <j.r.hacker@example.com>
+License: GPL-2
+
+Files: *
+Copyright: 2011 J. Random Hacker <j.r.hacker@example.com>
+License: GPL-2
+
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; version 2 dated June, 1991.
+ .
+ This package is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian systems, the full text of the GNU General Public License version 2
+ can be found in the file `/usr/share/common-licenses/GPL-2'.
diff --git a/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/debian/filea b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/debian/filea
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/desc b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/desc
new file mode 100644
index 0000000..2b6b1d6
--- /dev/null
+++ b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/desc
@@ -0,0 +1,6 @@
+Testname: source-copyright-global-files-wildcard-not-first-paragraph
+Version: 1.0
+Type: native
+Description: Test for Files: * not being the first paragraph
+Test-For:
+ global-files-wildcard-not-first-paragraph-in-dep5-copyright
diff --git a/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/tags b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/tags
new file mode 100644
index 0000000..9d6cf4b
--- /dev/null
+++ b/t/tests/source-copyright-global-files-wildcard-not-first-paragraph/tags
@@ -0,0 +1 @@
+FIXME

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


Reply to: