[lintian] 01/01: Add a pedantic warning for co-maintained packages that are not managed in a revision control system. (Closes: #884497)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit b5101b37c9dffdb0d08cf8e0eb2a593c76d11ca8
Author: Chris Lamb <lamby@debian.org>
Date: Sun Jan 28 17:48:53 2018 +1100
Add a pedantic warning for co-maintained packages that are not managed in a revision control system. (Closes: #884497)
---
checks/fields.desc | 9 +++++++++
checks/fields.pm | 12 +++++++++++-
debian/changelog | 3 +++
.../debian/debian/control.in | 18 ++++++++++++++++++
.../desc | 7 +++++++
.../tags | 1 +
6 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/checks/fields.desc b/checks/fields.desc
index a15b6be..e501299 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1399,3 +1399,12 @@ Info: The spcified Vcs-* header points to an area within the *.debian.org
elsewhere, potential contributors are likely to be most familiar with
Git.
Ref: https://lists.debian.org/debian-devel-announce/2017/08/msg00008.html
+
+Tag: co-maintained-package-with-no-vcs-headers
+Severity: pedantic
+Certainty: possible
+Info: Based on the content of the maintainer and uploader fields this
+ package is co-maintained but there are no Vcs-* fields.
+ .
+ It is recommended that shared maintenance of packages are co-ordinated
+ via a revision control system.
diff --git a/checks/fields.pm b/checks/fields.pm
index 1e8b950..cef7533 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -418,12 +418,16 @@ sub run {
#---- Maintainer
#---- Uploaders
+ my $is_comaintained = 0;
for my $f (qw(maintainer uploaders)) {
if (not defined $info->field($f)) {
tag 'no-maintainer-field' if $f eq 'maintainer';
} else {
my $maintainer = $info->field($f);
+ my $is_list = $maintainer =~ /\@lists(?:\.alioth)?\.debian\.org\b/;
+ $is_comaintained = 1 if $is_list;
+
# Note, not expected to hit on uploaders anymore, as dpkg
# now strips newlines for the .dsc, and the newlines don't
# hurt in debian/control
@@ -439,6 +443,7 @@ sub run {
my @uploaders = map { split /\@\S+\K\s*,\s*/ }
split />\K\s*,\s*/, $maintainer;
for my $uploader (@uploaders) {
+ $is_comaintained = 1;
check_maintainer($uploader, 'uploader');
if ( ((true { $_ eq $uploader } @uploaders) > 1)
and($duplicate_uploaders{$uploader}++ == 0)) {
@@ -448,7 +453,7 @@ sub run {
} else {
check_maintainer($maintainer, $f);
if ( $type eq 'source'
- && $maintainer =~ /\@lists(?:\.alioth)?\.debian\.org\b/
+ && $is_list
&& !defined $info->field('uploaders')) {
tag 'no-human-maintainers';
}
@@ -1354,6 +1359,11 @@ sub run {
tag 'vcs-fields-use-more-than-one-vcs', sort keys %seen_vcs
if keys %seen_vcs > 1;
+ tag 'co-maintained-package-with-no-vcs-headers'
+ if $type eq 'source'
+ and $is_comaintained
+ and not %seen_vcs;
+
#---- Checksums
tag 'no-strong-digests-in-dsc'
diff --git a/debian/changelog b/debian/changelog
index 610064d..2934b45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ lintian (2.5.73) UNRELEASED; urgency=medium
XXX: generate tag summary
+ * checks/fields.{desc,pm}:
+ + [CL] Add a pedantic warning for co-maintained packages that are not
+ managed in a revision control system. (Closes: #884497)
* checks/source-copyright.{desc,pm}:
+ [CL] Warn about packages that specify a Files-Excluded header without
a valid Format header as the former will be ignored by uscan(1).
diff --git a/t/tests/fields-co-maintained-package-with-no-vcs-headers/debian/debian/control.in b/t/tests/fields-co-maintained-package-with-no-vcs-headers/debian/debian/control.in
new file mode 100644
index 0000000..03f40bb
--- /dev/null
+++ b/t/tests/fields-co-maintained-package-with-no-vcs-headers/debian/debian/control.in
@@ -0,0 +1,18 @@
+Source: {$source}
+Priority: optional
+Section: {$section}
+Maintainer: {$author}
+Uploaders: Another Lintian Maintainer <foo@debian.org>
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Rules-Requires-Root: no
+Homepage: https://lintian.debian.org/
+
+Package: {$source}
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
diff --git a/t/tests/fields-co-maintained-package-with-no-vcs-headers/desc b/t/tests/fields-co-maintained-package-with-no-vcs-headers/desc
new file mode 100644
index 0000000..783b28b
--- /dev/null
+++ b/t/tests/fields-co-maintained-package-with-no-vcs-headers/desc
@@ -0,0 +1,7 @@
+Testname: fields-co-maintained-package-with-no-vcs-headers
+Version: 1.0
+Description: Check for co-maintained packages with no VCS headers
+Options: -I -E --pedantic
+Skeleton: pedantic
+Test-For:
+ co-maintained-package-with-no-vcs-headers
diff --git a/t/tests/fields-co-maintained-package-with-no-vcs-headers/tags b/t/tests/fields-co-maintained-package-with-no-vcs-headers/tags
new file mode 100644
index 0000000..67c6ea5
--- /dev/null
+++ b/t/tests/fields-co-maintained-package-with-no-vcs-headers/tags
@@ -0,0 +1 @@
+P: fields-co-maintained-package-with-no-vcs-headers source: co-maintained-package-with-no-vcs-headers
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: