Bug#770068: lintian: check for XS-Testsuite header
Package: lintian
Version: 2.5.30
Severity: normal
Tags: patch
Hi,
dpkg allows the Testsuite header since 1.17.10, so Lintian should warn
if packages still use the XS-Testsuite header.
An unknown (because codesearch cannot display the number of found
packages and I stopped clicking "next" after 10 pages) amount of
packages uses this header:
http://codesearch.debian.net/search?q=XS-Testsuite+path%3Adebian%2Fcontrol
Lintian should warn about its usage and recommend that the Testsuite
header is used instead.
Please see attached patch.
cheers, josch
>From 1c7c7dd3e9a5b4e28bc6838b51f2b0d5668dadbd Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Tue, 18 Nov 2014 17:11:19 +0100
Subject: [PATCH] add xs-testsuite-header-in-debian-control test
---
checks/control-file.desc | 8 ++++++++
checks/control-file.pm | 3 +++
checks/testsuite.desc | 4 ++--
debian/control | 2 +-
t/tests/testsuite-control-not-file/tags | 1 +
t/tests/testsuite-control-syntax/tags | 1 +
t/tests/testsuite-unknown-suite/tags | 1 +
7 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/checks/control-file.desc b/checks/control-file.desc
index a71182b..696d3f4 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -89,6 +89,14 @@ Info: There is an XS-Vcs-* field in the <tt>debian/control</tt> file. As
recognizes these headers and handles them correctly. Consider removing
the XS- prefix for this field.
+Tag: xs-testsuite-header-in-debian-control
+Severity: wishlist
+Certainty: certain
+Info: There is an XS-Testsuite field in the <tt>debian/control</tt> file. As
+ of dpkg 1.17.10, the XS- prefix is no longer necessary. dpkg now
+ recognizes this header and handles it correctly. Consider removing
+ the XS- prefix for this field.
+
Tag: xc-package-type-in-debian-control
Severity: pedantic
Certainty: certain
diff --git a/checks/control-file.pm b/checks/control-file.pm
index 64c2f6f..6cb1b52 100644
--- a/checks/control-file.pm
+++ b/checks/control-file.pm
@@ -88,6 +88,9 @@ sub run {
tag 'xs-vcs-header-in-debian-control', $field
if $src_fields->known($base);
}
+ if ($field eq 'xs-testsuite') {
+ tag 'xs-testsuite-header-in-debian-control', $field;
+ }
if ($field eq 'xc-package-type') {
tag 'xc-package-type-in-debian-control', "line $.";
}
diff --git a/checks/testsuite.desc b/checks/testsuite.desc
index 65386d9..b00ba3d 100644
--- a/checks/testsuite.desc
+++ b/checks/testsuite.desc
@@ -40,7 +40,7 @@ Info: The package provides a debian/tests/control file but no
.
For discoverability, packages shipping tests for the autopkgtest
testing framework should declare their presence in the package
- dsc file by adding "XS-Testsuite: autopkgtest" to their debian/control.
+ dsc file by adding "Testsuite: autopkgtest" to their debian/control.
Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests.rst;hb=HEAD
Tag: missing-runtime-tests-field
@@ -110,5 +110,5 @@ Severity: normal
Certainty: certain
Info: The dsc file sets Testsuite to a value other than autopkgtest,
the only one allowed. This field is most probably copied by
- dpkg-source from XS-Testsuite in debian/control.
+ dpkg-source from Testsuite in debian/control.
Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests.rst;hb=HEAD
diff --git a/debian/control b/debian/control
index f40c584..0068fd7 100644
--- a/debian/control
+++ b/debian/control
@@ -70,7 +70,7 @@ Build-Depends: aspell,
Standards-Version: 3.9.6
Vcs-Git: git://anonscm.debian.org/lintian/lintian.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=lintian/lintian.git
-XS-Testsuite: autopkgtest
+Testsuite: autopkgtest
Homepage: https://lintian.debian.org/
Package: lintian
diff --git a/t/tests/testsuite-control-not-file/tags b/t/tests/testsuite-control-not-file/tags
index 4cc5e56..ec620ee 100644
--- a/t/tests/testsuite-control-not-file/tags
+++ b/t/tests/testsuite-control-not-file/tags
@@ -1 +1,2 @@
I: testsuite-control-not-file source: debian-tests-control-is-not-a-regular-file
+I: testsuite-control-not-file source: xs-testsuite-header-in-debian-control xs-testsuite
diff --git a/t/tests/testsuite-control-syntax/tags b/t/tests/testsuite-control-syntax/tags
index 0423fc0..12b28b0 100644
--- a/t/tests/testsuite-control-syntax/tags
+++ b/t/tests/testsuite-control-syntax/tags
@@ -1 +1,2 @@
+I: testsuite-control-syntax source: xs-testsuite-header-in-debian-control xs-testsuite
W: testsuite-control-syntax source: syntax-error-in-debian-tests-control line 1: Cannot parse line "This file does not look like a Debian control file."
diff --git a/t/tests/testsuite-unknown-suite/tags b/t/tests/testsuite-unknown-suite/tags
index 1bfdd04..0596451 100644
--- a/t/tests/testsuite-unknown-suite/tags
+++ b/t/tests/testsuite-unknown-suite/tags
@@ -1 +1,2 @@
+I: testsuite-unknown-suite source: xs-testsuite-header-in-debian-control xs-testsuite
W: testsuite-unknown-suite source: unknown-testsuite golf
--
2.0.1
Reply to: