[lintian] 01/06: Ask maintainers to add a comment header to debian/copyright if their package is in contrib or non-free. (Closes: #773562)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit 82763046d0a6ae7668cd23af2102b0b79ac73a84
Author: Chris Lamb <lamby@debian.org>
Date: Mon Jan 29 22:19:02 2018 +0000
Ask maintainers to add a comment header to debian/copyright if their package is in contrib or non-free. (Closes: #773562)
---
checks/source-copyright.desc | 11 +++++++++++
checks/source-copyright.pm | 6 +++++-
debian/changelog | 2 ++
.../desc | 6 ++++++
.../tags | 0
.../debian/debian/copyright | 23 ++++++++++++++++++++++
.../desc | 6 ++++++
.../tags | 1 +
8 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index e90086a..313bb1b 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -390,3 +390,14 @@ Info: The specified paragraph in the machine readable copyright file references
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/
+
+Tag: missing-explanation-for-contrib-or-non-free-package
+Severity: wishlist
+Certainty: certain
+Info: The specified package is in the contrib or non-free archive
+ area but does not include a "Comment" (or "Disclaimer") header in
+ its copyright file.
+ .
+ Please add a brief comment why this package cannot be part of the
+ main Debian distribution.
+Ref: policy 12.5
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 1432e2c..8bbbf5a 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -30,7 +30,7 @@ use constant {
WC_TYPE_DECENDANTS => 'DECENDANTS',
};
-use List::MoreUtils qw(any);
+use List::MoreUtils qw(any none);
use Text::Levenshtein qw(distance);
use Lintian::Relation::Version qw(versions_compare);
@@ -278,6 +278,10 @@ sub _parse_dep5 {
"(line $lines[0]{'format'})";
}
+ 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);
+
my (undef, $full_license_header, undef,@short_licenses_header)
=parse_license($first_para->{'license'}, 1);
for my $short_license (@short_licenses_header) {
diff --git a/debian/changelog b/debian/changelog
index 1573b28..a3035f2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -45,6 +45,8 @@ lintian (2.5.73) UNRELEASED; urgency=medium
+ [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)
+ + [CL] Ask maintainers to add a comment header to debian/copyright if
+ their package is in contrib or non-free. (Closes: #773562)
* data/common/dh_addons:
+ [CL] Move/create from data/debhelper/dh_addons as we plan to use
diff --git a/t/tests/source-copyright-missing-non-free-explanation-unrel/desc b/t/tests/source-copyright-missing-non-free-explanation-unrel/desc
new file mode 100644
index 0000000..2e51af5
--- /dev/null
+++ b/t/tests/source-copyright-missing-non-free-explanation-unrel/desc
@@ -0,0 +1,6 @@
+Testname: source-copyright-missing-non-free-explanation-unrel
+Version: 1.0
+Description: Test for missing contrib/non-free explanations
+Section: contrib/doc
+Test-Against:
+ missing-explanation-for-contrib-or-non-free-package
diff --git a/t/tests/source-copyright-missing-non-free-explanation-unrel/tags b/t/tests/source-copyright-missing-non-free-explanation-unrel/tags
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/source-copyright-missing-non-free-explanation/debian/debian/copyright b/t/tests/source-copyright-missing-non-free-explanation/debian/debian/copyright
new file mode 100644
index 0000000..5c38963
--- /dev/null
+++ b/t/tests/source-copyright-missing-non-free-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 <rra@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-non-free-explanation/desc b/t/tests/source-copyright-missing-non-free-explanation/desc
new file mode 100644
index 0000000..1b5d1cd
--- /dev/null
+++ b/t/tests/source-copyright-missing-non-free-explanation/desc
@@ -0,0 +1,6 @@
+Testname: source-copyright-missing-non-free-explanation
+Version: 1.0
+Description: Test for missing contrib/non-free explanations
+Section: contrib/doc
+Test-For:
+ missing-explanation-for-contrib-or-non-free-package
diff --git a/t/tests/source-copyright-missing-non-free-explanation/tags b/t/tests/source-copyright-missing-non-free-explanation/tags
new file mode 100644
index 0000000..399b48e
--- /dev/null
+++ b/t/tests/source-copyright-missing-non-free-explanation/tags
@@ -0,0 +1 @@
+I: source-copyright-missing-non-free-explanation source: missing-explanation-for-contrib-or-non-free-package
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: