Bug#790739: don't warn about dev-pkg-without-shlib-symlink for GCC runtime libraries
* Jakub Wilk <jwilk@debian.org>, 2015-11-29, 12:31:
Something fishy is going on here.
So the fishy thing is that checks/shared-libs.pm has this:
my $MA_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/);
whereas checks/binaries.pm and checks/files.pm have this:
my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/,
sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } });
So, thanks data caching, $MA_DIRS could be initialized with a completely
different structure than the shared-libs check expected.
This preprocessing (introduced in 37774bb101dd) doesn't seem useful to
me, so I got rid of it. I'd appreciate if someone familiar with Lintian
codebase reviewed the patch.
--
Jakub Wilk
diff --git a/checks/binaries.pm b/checks/binaries.pm
--- a/checks/binaries.pm
+++ b/checks/binaries.pm
@@ -86,8 +86,7 @@
= Lintian::Data->new('binaries/embedded-libs', qr/\s*+\|\|/,
\&_embedded_libs);
-our $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/,
- sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } });
+our $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/);
sub _split_hash {
my (undef, $val) = @_;
@@ -192,9 +191,8 @@
# This avoids false positives with plugins like Apache modules,
# which may have their own SONAMEs but which don't matter for the
# purposes of this check. Also filter out nsswitch modules
- if (defined($MULTIARCH_DIRS->value($arch))) {
- $madir = $MULTIARCH_DIRS->value($arch)->{'dir'};
- } else {
+ $madir = $MULTIARCH_DIRS->value($arch);
+ if (not defined($madir)) {
# In the case that the architecture is "all" or unknown (or we do
# not know the multi-arch path for a known architecture) , we assume
# it the multi-arch path to be this (hopefully!) non-existent path to
@@ -202,8 +200,6 @@
$madir = './!non-existent-path!/./';
}
- $madir = './!non-existent-path!/./' unless defined $madir;
-
$gnu_triplet_re = quotemeta $madir;
$gnu_triplet_re =~ s,^i386,i[3-6]86,;
$ruby_triplet_re = $gnu_triplet_re;
diff --git a/checks/files.pm b/checks/files.pm
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -37,8 +37,7 @@
my $LOCALE_CODES = Lintian::Data->new('files/locale-codes', qr/\s++/);
my $INCORRECT_LOCALE_CODES
= Lintian::Data->new('files/incorrect-locale-codes', qr/\s++/);
-my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/,
- sub { return { 'dir' => $_[1], 'match' => qr/\Q$_[1]\E/ } });
+my $MULTIARCH_DIRS = Lintian::Data->new('common/multiarch-dirs', qr/\s++/);
my $PRIVACY_BREAKER_WEBSITES= Lintian::Data->new(
'files/privacy-breaker-websites',
@@ -657,17 +656,15 @@
# check if pkgconfig file include path point to
# arch specific dir
MULTI_ARCH_DIR:
- foreach my $multiarch_dir ($MULTIARCH_DIRS->all) {
- my $value = $MULTIARCH_DIRS->value($multiarch_dir);
- my $pkgconfig_dir = $value->{'dir'};
- my $regex = $value->{'match'};
- if ($pkg_config_arch eq $pkgconfig_dir) {
+ foreach my $arch ($MULTIARCH_DIRS->all) {
+ my $madir = $MULTIARCH_DIRS->value($arch);
+ if ($pkg_config_arch eq $madir) {
next MULTI_ARCH_DIR;
}
- if ($block =~ m{\W$regex(\W|$)}xms) {
+ if ($block =~ m{\W\Q$madir\E(\W|$)}xms) {
tag 'pkg-config-multi-arch-wrong-dir',$file,
'full text contains architecture specific dir',
- $pkgconfig_dir;
+ $madir;
last MULTI_ARCH_DIR;
}
}
Reply to: