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