[lintian] 04/07: Check for packages that specify binary dependencies on toolchain packages such as cdbs or debhelper. (Closes: #700953)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit d177589edbef64aa837ff3984f9fa387ec3d819c
Author: Chris Lamb <lamby@debian.org>
Date: Mon Jan 29 05:28:31 2018 +0000
Check for packages that specify binary dependencies on toolchain packages such as cdbs or debhelper. (Closes: #700953)
---
checks/fields.desc | 12 +++++++++++-
checks/fields.pm | 5 +++++
data/fields/toolchain | 2 ++
debian/changelog | 2 ++
t/tests/fields-depends-general/debian/debian/control.in | 4 ++--
t/tests/fields-depends-general/desc | 1 +
t/tests/fields-depends-general/tags | 2 ++
7 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/checks/fields.desc b/checks/fields.desc
index fe4dbbe..24f0f58 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1406,7 +1406,7 @@ 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
+ It is recommended
via a revision control system.
Tag: multi-arch-same-package-has-arch-specific-overrides
@@ -1415,3 +1415,13 @@ Certainty: certain
Info: The specified file contains architecture-specific Lintian overrides
but this package is declared as <tt>Multi-Arch: same</tt>.
Ref: lintian 2.4.3, #787406
+
+Tag: binary-package-depends-on-toolchain-package
+Severity: normal
+Certainty: possible
+Info: The package specifies a binary dependecy on a "toolchain" package
+ such as debhelper or cdbs. This is likely to a mistake as these packages
+ are typically specified as build-dependencis.
+ .
+ If the package intentionally requires such a dependency, please add a
+ Lintian override.
diff --git a/checks/fields.pm b/checks/fields.pm
index c0a3509..872a6ec 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -43,6 +43,7 @@ use constant {
};
our $KNOWN_ESSENTIAL = Lintian::Data->new('fields/essential');
+our $KNOWN_TOOLCHAIN = Lintian::Data->new('fields/toolchain');
our $KNOWN_METAPACKAGES = Lintian::Data->new('fields/metapackages');
our $NO_BUILD_DEPENDS = Lintian::Data->new('fields/no-build-depends');
our $KNOWN_SECTIONS = Lintian::Data->new('fields/archive-sections');
@@ -893,6 +894,10 @@ sub run {
&& $pkg !~ m/-(?:dev|docs?|tools|bin)$/
&& $part_d_orig =~ m/-docs?$/);
+ tag 'binary-package-depends-on-toolchain-package',
+ "$field: $part_d_orig"
+ if $KNOWN_TOOLCHAIN->known($d_pkg);
+
# default-jdk-doc must depend on openjdk-X-doc (or
# classpath-doc) to be useful; other packages
# should depend on default-jdk-doc if they want
diff --git a/data/fields/toolchain b/data/fields/toolchain
new file mode 100644
index 0000000..d1d9497
--- /dev/null
+++ b/data/fields/toolchain
@@ -0,0 +1,2 @@
+cdbs
+debhelper
diff --git a/debian/changelog b/debian/changelog
index 5766f66..161807d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ lintian (2.5.73) UNRELEASED; urgency=medium
+ [CL] Warn about Multi-Arch: same packages that ship
architecture-specific Lintian overrides. Thanks to Sebastian
Ramacher for the report. (Closes: #787469)
+ + [CL] Check for packages that specify binary dependencies on toolchain
+ packages such as cdbs or debhelper. (Closes: #700953)
* checks/java.{desc,pm}:
+ [CL] Check for .jar files that do not match the Debian Java policy.
(Closes: #791552)
diff --git a/t/tests/fields-depends-general/debian/debian/control.in b/t/tests/fields-depends-general/debian/debian/control.in
index de9129a..2844548 100644
--- a/t/tests/fields-depends-general/debian/debian/control.in
+++ b/t/tests/fields-depends-general/debian/debian/control.in
@@ -12,7 +12,7 @@ Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, xorg, bash,
conflict-dep, gawk | awk, new-package | xbase-clients (>= 0.1), {$source},
gaim (>= 0.1), emacs21, emacs22, emacs23, makedev, libtest-simple-perl (>= 0.98),
packaging-dev, xfont-a, emacs22-gtk, emacs23-el, emacs23-nox, emacs23-lucid,
- emacs222, perl-modules
+ emacs222, perl-modules, debhelper
Breaks: package-without-version, {$source} (<< 0.1),
replaced-wo-version
Replaces: replaced-wo-version
@@ -25,7 +25,7 @@ Description: {$description}
Package: lib{$source}
Architecture: {$architecture}
Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, libdb1-compat, perl-modules-5.22
-Recommends: debconf-doc
+Recommends: debconf-doc, cdbs
Section: libs
Description: {$description} -- fake library
This is a fake library designed to exercise some feature or tag of
diff --git a/t/tests/fields-depends-general/desc b/t/tests/fields-depends-general/desc
index a0c0186..47223ad 100644
--- a/t/tests/fields-depends-general/desc
+++ b/t/tests/fields-depends-general/desc
@@ -2,6 +2,7 @@ Testname: fields-depends-general
Version: 1.0
Description: General tests for binary package dependencies
Test-For:
+ binary-package-depends-on-toolchain-package
breaks-without-version
conflicts-with-dependency
conflicts-with-version
diff --git a/t/tests/fields-depends-general/tags b/t/tests/fields-depends-general/tags
index 8501408..b8c6714 100644
--- a/t/tests/fields-depends-general/tags
+++ b/t/tests/fields-depends-general/tags
@@ -14,6 +14,7 @@ I: fields-depends-general: ored-depends-on-obsolete-package depends: xbase-clien
W: fields-depends-general source: package-depends-on-itself fields-depends-general depends
W: fields-depends-general source: versioned-dependency-satisfied-by-perl build-depends: libtest-simple-perl (>= 0.98)
W: fields-depends-general-doc: doc-package-depends-on-main-package depends
+W: fields-depends-general: binary-package-depends-on-toolchain-package depends: debhelper
W: fields-depends-general: breaks-without-version package-without-version
W: fields-depends-general: depends-exclusively-on-makedev depends
W: fields-depends-general: depends-on-old-emacs depends: emacs21
@@ -26,4 +27,5 @@ W: fields-depends-general: depends-on-old-emacs depends: emacs23-nox
W: fields-depends-general: depends-on-packaging-dev depends
W: fields-depends-general: package-relation-with-self breaks: fields-depends-general (<< 0.1)
W: fields-depends-general: versioned-dependency-satisfied-by-perl depends: libtest-simple-perl (>= 0.98)
+W: libfields-depends-general: binary-package-depends-on-toolchain-package recommends: cdbs
W: libfields-depends-general: lib-recommends-documentation recommends: debconf-doc
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: