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

lamby pushed a commit to branch master
in repository lintian.

commit 88a1b4dff503bd9afd1e34e152b644d74db67735
Author: Chris Lamb <la...@debian.org>
Date:   Tue Feb 13 17:00:42 2018 +0000

    Emit a pendatic warning for packages with repacked upstream tarballs that 
lack a Files-Excluded or Comment header in debian/copyright.
---
 checks/source-copyright.desc                       | 11 ++++++++++
 checks/source-copyright.pm                         |  3 +++
 debian/changelog                                   |  4 ++++
 .../debian/debian/copyright                        | 24 ++++++++++++++++++++++
 .../desc                                           |  8 ++++++++
 .../tags                                           |  1 +
 .../debian/debian/copyright                        | 23 +++++++++++++++++++++
 .../desc                                           |  8 ++++++++
 .../tags                                           |  2 ++
 9 files changed, 84 insertions(+)

diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index c4039e8..0881e7e 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -401,3 +401,14 @@ Info: The specified package is in the contrib or non-free 
archive
  Please add a brief comment why this package cannot be part of the
  main Debian distribution.
 Ref: policy 12.5
+
+Tag: missing-explanation-for-repacked-upstream-tarball
+Severity: pedantic
+Certainty: possible
+Info: The version of this package contains <tt>dfsg</tt>, <tt>ds</tt>,
+ or <tt>debian</tt> which normally indicates that the upstream source
+ has been repackaged, but there is no "Comment" or "Files-Excluded"
+ header in its copyright file which explains the reason why.
+ .
+ Please add a comment why this tarball was repacked or add a suitable
+ "Files-Excluded" header.
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 04619c4..47409e9 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -283,6 +283,9 @@ sub _parse_dep5 {
     tag 'missing-explanation-for-contrib-or-non-free-package'
       if $info->source_field('section', '') =~ m{^(contrib|non-free)(/.+)?$}
       and none { defined $first_para->{$_} } qw(comment disclaimer);
+    tag 'missing-explanation-for-repacked-upstream-tarball'
+      if $info->field('version', '') =~ m{(?:dfsg|debian|ds|repack)}
+      and none { defined $first_para->{$_} } qw(comment files-excluded);
 
     my (undef, $full_license_header, undef,@short_licenses_header)
       =parse_license($first_para->{'license'}, 1);
diff --git a/debian/changelog b/debian/changelog
index aa5a74b..1e7021c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,10 @@ lintian (2.5.75) UNRELEASED; urgency=medium
   * checks/scripts.{desc,pm}:
     + [CL] Check for maintainer scripts that call udevadm without a guard
       as it can fail within a chroot.  (Closes: #890224)
+  * checks/source-copyright.{desc,pm}:
+    + [CL] Emit a pendatic warning for packages with repacked upstream
+      tarballs that lack a Files-Excluded or Comment header in
+      debian/copyright.
 
   * commands/reporting-html-reports.html:
     + [NT] Minimize generated SVG files if scour is installed and
diff --git 
a/t/tests/source-copyright-missing-repack-explanation-unrel/debian/debian/copyright
 
b/t/tests/source-copyright-missing-repack-explanation-unrel/debian/debian/copyright
new file mode 100644
index 0000000..6a3aeb6
--- /dev/null
+++ 
b/t/tests/source-copyright-missing-repack-explanation-unrel/debian/debian/copyright
@@ -0,0 +1,24 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Lintian
+Upstream-Contact: <debian-lint-maint@lists.debian.org>
+Source: http://lintian.debian.org
+Files-Excluded: dummy
+
+Files: *
+Copyright: 2009, Russ Allbery <r...@debian.org>
+License: GPL-2+
+ This program is free software; you may redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ .
+ This 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.
+ .
+ A copy of the GNU General Public License version 2 is available as
+ /usr/share/common-licenses/GPL-2 in the Debian GNU/Linux distribution
+ or at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+ You can also obtain it by writing to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/t/tests/source-copyright-missing-repack-explanation-unrel/desc 
b/t/tests/source-copyright-missing-repack-explanation-unrel/desc
new file mode 100644
index 0000000..d6abaef
--- /dev/null
+++ b/t/tests/source-copyright-missing-repack-explanation-unrel/desc
@@ -0,0 +1,8 @@
+Testname: source-copyright-missing-repack-explanation-unrel
+Type: non-native
+Version: 1+dfsg-1
+Description: Test for missing repack explanations (false-positive)
+Options: -I -E --pedantic
+Skeleton: pedantic
+Test-Against:
+ missing-explanation-for-repacked-upstream-tarball
diff --git a/t/tests/source-copyright-missing-repack-explanation-unrel/tags 
b/t/tests/source-copyright-missing-repack-explanation-unrel/tags
new file mode 100644
index 0000000..5d832db
--- /dev/null
+++ b/t/tests/source-copyright-missing-repack-explanation-unrel/tags
@@ -0,0 +1 @@
+P: source-copyright-missing-repack-explanation-unrel source: 
debian-watch-does-not-check-gpg-signature
diff --git 
a/t/tests/source-copyright-missing-repack-explanation/debian/debian/copyright 
b/t/tests/source-copyright-missing-repack-explanation/debian/debian/copyright
new file mode 100644
index 0000000..5c38963
--- /dev/null
+++ 
b/t/tests/source-copyright-missing-repack-explanation/debian/debian/copyright
@@ -0,0 +1,23 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Lintian
+Upstream-Contact: <debian-lint-maint@lists.debian.org>
+Source: http://lintian.debian.org
+
+Files: *
+Copyright: 2009, Russ Allbery <r...@debian.org>
+License: GPL-2+
+ This program is free software; you may redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ .
+ This 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.
+ .
+ A copy of the GNU General Public License version 2 is available as
+ /usr/share/common-licenses/GPL-2 in the Debian GNU/Linux distribution
+ or at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+ You can also obtain it by writing to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/t/tests/source-copyright-missing-repack-explanation/desc 
b/t/tests/source-copyright-missing-repack-explanation/desc
new file mode 100644
index 0000000..cfe318d
--- /dev/null
+++ b/t/tests/source-copyright-missing-repack-explanation/desc
@@ -0,0 +1,8 @@
+Testname: source-copyright-missing-repack-explanation
+Type: non-native
+Version: 1+dfsg-1
+Description: Test for missing repack explanations
+Options: -I -E --pedantic
+Skeleton: pedantic
+Test-For:
+ missing-explanation-for-repacked-upstream-tarball
diff --git a/t/tests/source-copyright-missing-repack-explanation/tags 
b/t/tests/source-copyright-missing-repack-explanation/tags
new file mode 100644
index 0000000..ba4c3b5
--- /dev/null
+++ b/t/tests/source-copyright-missing-repack-explanation/tags
@@ -0,0 +1,2 @@
+P: source-copyright-missing-repack-explanation source: 
debian-watch-does-not-check-gpg-signature
+P: source-copyright-missing-repack-explanation source: 
missing-explanation-for-repacked-upstream-tarball

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

Reply via email to