[lintian] 01/08: c/binaries: Detect ELF binaries like every other check
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 42c04c03c212af7aef1c7c88edc3c748bb7070cd
Author: Niels Thykier <niels@thykier.net>
Date: Mon Jan 25 18:06:01 2016 +0000
c/binaries: Detect ELF binaries like every other check
All other checks uses "file(1)" info saying "ELF" to detect a binary
being an ELF. Have c/binaries do the same for consistency.
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/binaries.pm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/checks/binaries.pm b/checks/binaries.pm
index b7833d4..ea0437b 100644
--- a/checks/binaries.pm
+++ b/checks/binaries.pm
@@ -128,14 +128,17 @@ sub run {
my $objdump = $info->objdump_info->{$file};
my $has_lfs;
my $is_profiled = 0;
+ # $file can be an object inside a static lib. These do
+ # not appear in the output of our file_info collection.
+ my $file_info = $info->file_info($file) // '';
# The LFS check only works reliably for ELF files due to the
# architecture regex.
- if ($objdump->{'ELF'}) {
+ if ($file_info =~ m/^[^,]*\bELF\b/o) {
# Only 32bit ELF binaries can lack LFS.
$ARCH_32_REGEX = $ARCH_REGEX->value('32')
unless defined $ARCH_32_REGEX;
- $has_lfs = 1 unless $info->file_info($file) =~ m/$ARCH_32_REGEX/o;
+ $has_lfs = 1 unless $file_info =~ m/$ARCH_32_REGEX/o;
# We don't care if it is a debug file
$has_lfs = 1 if $file =~ m,^usr/lib/debug/,;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: