[lintian] 01/01: Warn about library packages with excessive priority. Thanks to Josh Triplett for the report. (Closes: #834290)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit 588cbc9069b53c8be4ca6e66e010cfb507b095e6
Author: Chris Lamb <lamby@debian.org>
Date: Fri Dec 15 23:00:00 2017 +0000
Warn about library packages with excessive priority. Thanks to Josh Triplett for the report. (Closes: #834290)
---
checks/fields.desc | 13 +++++++++++++
checks/fields.pm | 5 +++++
debian/changelog | 3 +++
.../debian/debian/control.in | 18 ++++++++++++++++++
.../debian/debian/rules | 9 +++++++++
.../fields-excessive-priority-for-library-package/desc | 5 +++++
.../fields-excessive-priority-for-library-package/tags | 1 +
7 files changed, 54 insertions(+)
diff --git a/checks/fields.desc b/checks/fields.desc
index b834393..7a16d2c 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1343,3 +1343,16 @@ Severity: pedantic
Certainty: certain
Info: The Homepage field uses an unencrypted transport protocol for the
URI.
+
+Tag: excessive-priority-for-library-package
+Severity: normal
+Certainty: possible
+Info: The given package appears to be a library package, but it has "Priority"
+ of "required", "important", or "standard".
+ .
+ In general, a library package should only get pulled in on a system because
+ some other package depends on it; no library package needs installation on a
+ system where nothing uses it.
+ .
+ Please update <tt>debian/control</tt> and downgrade the severity to, for
+ example, <tt>Priority: optional</tt>.
diff --git a/checks/fields.pm b/checks/fields.pm
index 6f5cbfc..af97090 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -591,6 +591,11 @@ sub run {
tag 'unknown-priority', $priority
unless $KNOWN_PRIOS->known($priority);
+
+ tag 'excessive-priority-for-library-package', $priority
+ if $pkg =~ m/^lib.+-dev$/o
+ and $info->field('section', '') eq 'libdevel';
+ any { $_ eq $priority } qw(required important standard)
}
#---- Standards-Version
diff --git a/debian/changelog b/debian/changelog
index 3b3721f..f0fb47c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ lintian (2.5.63) UNRELEASED; urgency=medium
* checks/cruft.desc:
+ [CL] Add debian/changelog to the file-contains-trailing-whitespace
example to make it even easier to copy-paste.
+ * checks/fields.{pm,desc}:
+ + [CL] Warn about library packages with excessive priority. Thanks to
+ Josh Triplett for the report. (Closes: #834290)
* checks/files.{pm,desc}:
+ [CL] Warn about Multi-Arch: foreign packages that ship CMake,
pkg-config or static libraries in public, architecture-dependent
diff --git a/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in b/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in
new file mode 100644
index 0000000..98669a3
--- /dev/null
+++ b/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in
@@ -0,0 +1,18 @@
+Source: {$source}
+Priority: optional
+Section: libs
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Rules-Requires-Root: no
+
+Package: lib{$source}-dev
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Section: libdevel
+Priority: standard
+Description: {$description} (dev)
+ 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-excessive-priority-for-library-package/debian/debian/rules b/t/tests/fields-excessive-priority-for-library-package/debian/debian/rules
new file mode 100644
index 0000000..6dd864a
--- /dev/null
+++ b/t/tests/fields-excessive-priority-for-library-package/debian/debian/rules
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
+override_dh_auto_install:
+ set -e ; for P in $$(dh_listpackages -a) ; do \
+ dh_install -p$$P some-file usr/lib/$$P ; \
+ done
diff --git a/t/tests/fields-excessive-priority-for-library-package/desc b/t/tests/fields-excessive-priority-for-library-package/desc
new file mode 100644
index 0000000..3d8f2f7
--- /dev/null
+++ b/t/tests/fields-excessive-priority-for-library-package/desc
@@ -0,0 +1,5 @@
+Testname: fields-excessive-priority-for-library-package
+Version: 1.0
+Description: Library packages with excessive Priority field.
+Test-For:
+ excessive-priority-for-library-package
diff --git a/t/tests/fields-excessive-priority-for-library-package/tags b/t/tests/fields-excessive-priority-for-library-package/tags
new file mode 100644
index 0000000..22cee04
--- /dev/null
+++ b/t/tests/fields-excessive-priority-for-library-package/tags
@@ -0,0 +1 @@
+W: libfields-excessive-priority-for-library-package-dev: excessive-priority-for-library-package standard
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: