Commit 96acc822 authored by Chris Lamb's avatar Chris Lamb 💬

Check for packages that use dh_runit without specifying a Breaks on the...

Check for packages that use dh_runit without specifying a Breaks on the "${runit:Breaks}" substvar. (Closes: #920299)
parent 99a8b4fd
......@@ -505,3 +505,16 @@ Info: The <tt>debian/rules</tt> file appears to include a suspiciously
.
Please remove the unnecessary overrides.
Ref: debhelper(7), dh(1)
Tag: package-uses-dh-runit-but-lacks-breaks-substvar
Severity: normal
Certainty: possible
Info: This source package appears to use <tt>dh_runit(1)</tt> but the
specified binary package does not define a <tt>Breaks:</tt> including
the <tt>${runit:Breaks}</tt> substitution variable.
.
<tt>dh_runit(1)</tt> may generate scripts that make assumptions about
the version of <tt>runit</tt> in use.
.
Please add the corresponding <tt>Breaks</tt> relation.
Refs: dh_runit(1)
......@@ -69,6 +69,7 @@ sub run {
my %seen = (
'python2' => 0,
'python3' => 0,
'runit' => 0,
);
my %overrides;
......@@ -269,6 +270,7 @@ sub run {
for my $binpkg (@pkgs) {
next if $info->binary_package_type($binpkg) ne 'deb';
my $breaks = $info->binary_relation($binpkg, 'breaks');
my $strong = $info->binary_relation($binpkg, 'strong');
my $all = $info->binary_relation($binpkg, 'all');
......@@ -279,6 +281,10 @@ sub run {
unless $strong->implies($MISC_DEPENDS);
}
tag 'package-uses-dh-runit-but-lacks-breaks-substvar',$binpkg
if $seen{'runit'}
and $strong->implies('runit')
and not $breaks->implies('${runit:Breaks}');
}
my $compatnan = 0;
......
......@@ -17,6 +17,7 @@ Build-Depends:
default-jdk-headless <!nocheck> | default-jdk <!nocheck>,
dh-elpa <!nocheck> | bash (<< 4.4) <!nocheck>,
dh-python <!nocheck>,
dh-runit <!nocheck>,
diffstat <!nocheck>,
docbook-utils,
docbook-xml,
......
Source: {$source}
Priority: optional
Section: python
Maintainer: {$author}
Standards-Version: {$standards_version}
Build-Depends: {$build_depends}, dh-runit
Rules-Requires-Root: no
Package: {$source}-missing
Architecture: {$package_architecture}
Depends: $\{misc:Depends\}, runit
Description: {$description} (true positive)
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.
.
Missing breaks.
Package: {$source}-present
Architecture: {$package_architecture}
Depends: $\{misc:Depends\}, runit
Breaks: $\{runit:Breaks\}
Description: {$description} (false positive)
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.
.
Has breaks.
Package: {$source}-unrelated
Architecture: all
Depends: $\{misc:Depends\}
Breaks: $\{runit:Breaks\}
Description: {$description} (unrelated)
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.
.
No, breaks, but unrelated.
Skeleton: upload-native
Testname: debhelper-dh-runit-but-lacks-breaks-substvar
Version: 1.0
Description: Check Breaks requirements for dh --with dh_runit
Test-Depends:
dh-runit
Test-For:
package-uses-dh-runit-but-lacks-breaks-substvar
W: debhelper-dh-runit-but-lacks-breaks-substvar source: package-uses-dh-runit-but-lacks-breaks-substvar debhelper-dh-runit-but-lacks-breaks-substvar-missing
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment