[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.6-15-g4f4dee6



The following commit has been merged in the master branch:
commit 4f4dee6a8f60e728faef1ec5326c62b022d3ebab
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Mar 18 14:33:18 2012 +0100

    objdump-info: Use L::Collect to find ELF files
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/collection/objdump-info b/collection/objdump-info
index f3dd51e..8151664 100755
--- a/collection/objdump-info
+++ b/collection/objdump-info
@@ -27,14 +27,14 @@ use strict;
 use warnings;
 
 use lib "$ENV{'LINTIAN_ROOT'}/lib/";
+use Lintian::Collect;
 use Util qw(fail);
 
-my (undef, undef, $dir) = @ARGV;
-
+my ($pkg, $type, $dir) = @ARGV;
+my $info = Lintian::Collect->new ($pkg, $type, $dir);
 my $failed = 0;
 
-open FILES, '<', "$dir/file-info"
-    or fail("cannot open file-info: $!");
+my $file_info = $info->file_info;
 
 open OUT, '>', "$dir/objdump-info"
     or fail("cannot open objdump-info: $!");
@@ -42,9 +42,9 @@ open OUT, '>', "$dir/objdump-info"
 chdir ("$dir/unpacked")
     or fail ("unable to chdir to unpacked: $!\n");
 
-while (<FILES>) {
-    if (m/^(.+?)\x00\s.*ELF/) {
-        my $bin = $1;
+foreach my $bin (@{ $info->sorted_file_info }) {
+    my $finfo = $file_info->{$bin};
+    if ($finfo =~ m/^\bELF\b/) {
 
         print OUT "-- $bin\n";
 
@@ -227,7 +227,6 @@ while (<FILES>) {
     }
 }
 
-close FILES;
 close OUT or fail("cannot write objdump-info: $!");
 
 exit $failed;
diff --git a/debian/changelog b/debian/changelog
index 33a1c6e..6d47b03 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,7 @@ lintian (2.5.7) UNRELEASED; urgency=low
   * collection/objdump-info:
     + [NT] Use "fail" from Util.pm rather than embedding a copy of
       it.
+    + [NT] Use Lintian::Collect to find ELF files.
 
   * frontend/lintian:
     + [JW] Fix typo in error message.
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index b0d81de..591caf2 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -171,7 +171,7 @@ sub objdump_info {
 
         next if m/^\s*$/o;
 
-        if (m,^-- \./(.+)$,) {
+        if (m,^-- (?:\./)?(.+)$,) {
             if ($file) {
                 $objdump_info{$file->{name}} = $file;
             }
@@ -205,9 +205,9 @@ sub objdump_info {
                 push @{$file->{NOTES}}, 'File format not recognized';
             } elsif (m/^objdump: .*?: File truncated$/) {
                 push @{$file->{NOTES}}, 'File truncated';
-            } elsif (m/^objdump: \..*?: Packed with UPX$/) {
+            } elsif (m/^objdump: .*?: Packed with UPX$/) {
                 push @{$file->{NOTES}}, 'Packed with UPX';
-            } elsif (m/objdump: \..*?: Invalid operation$/) {
+            } elsif (m/objdump: .*?: Invalid operation$/) {
                 # Don't anchor this regex since it can be interspersed with other
                 # output and hence not on the beginning of a line.
                 push @{$file->{NOTES}}, 'Invalid operation';

-- 
Debian package checker


Reply to: