Commit f07916d7 authored by Chris Lamb's avatar Chris Lamb 💬

Don't emit uses-dpkg-database-directly for d-i components.

parent 2052a06a
......@@ -23,7 +23,7 @@ use strict;
use warnings;
use autodie;
use List::MoreUtils qw(none);
use List::MoreUtils qw(any);
use Lintian::Data;
use Lintian::Tags qw(tag);
......@@ -1507,7 +1507,7 @@ sub run {
# ---------------- using dpkg internals
if ($fname !~ m,^usr/share/(?:doc|locale)/,
and none { $_ eq $source_pkg } @ALLOWED_USES_DPKG_DATABASE) {
and check_uses_dpkg($source_pkg, $pkg_section)) {
my $strings = slurp_entire_file($info->strings($file));
# If we have strings(1) output (eg. we are an ELF
......@@ -2034,14 +2034,15 @@ sub run {
tag 'missing-depends-on-sensible-utils', $file
if not $has_sensible_utils and detect_sensible_utils($file);
if (check_uses_dpkg($source_pkg, $pkg_section)) {
my $fd2 = $file->open;
while (<$fd2>) {
tag 'uses-dpkg-database-directly', $file, "(line $.)"
if m,/var/lib/dpkg,
and none { $_ eq $source_pkg } @ALLOWED_USES_DPKG_DATABASE;
if m,/var/lib/dpkg,;
}
close($fd2);
}
}
close($fd);
if (!$is_dummy && !$arch_dep_files && $arch ne 'all') {
......@@ -2357,6 +2358,15 @@ sub detect_sensible_utils {
return;
}
sub check_uses_dpkg {
my ($source_pkg, $pkg_section) = @_;
return 0 if $pkg_section eq 'debian-installer';
return 0 if any { $_ eq $source_pkg } @ALLOWED_USES_DPKG_DATABASE;
return 1;
}
1;
# Local Variables:
......
lintian (2.5.117) UNRELEASED; urgency=medium
* checks/files.pm:
+ [CL] Don't emit uses-dpkg-database-directly for d-i components; they
likely know what they are doing with no alternatives.
* checks/watch-file.desc:
+ [CL] Correct grammar of the debian-watch-does-not-check-gpg-signature
tag description.
......
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