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

[SCM] Debian package checker branch, master, updated. 2.5.6-94-g6f510da



The following commit has been merged in the master branch:
commit 6f510dab777631524d01ef117789219469eff528
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 14 12:34:12 2012 +0200

    coll/strings: compress output of strings
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/binaries b/checks/binaries
index 14ae4b3..f8820c6 100644
--- a/checks/binaries
+++ b/checks/binaries
@@ -309,7 +309,7 @@ foreach my $file (@{$info->sorted_index}) {
         }
     }
 
-    my $strings = slurp_entire_file("strings/$file");
+    my $strings = slurp_entire_file ($info->strings ($file));
     check_spelling('spelling-error-in-binary', $strings, $file, { $pkg => 1 });
 
     # stripped?
diff --git a/collection/strings b/collection/strings
index a93d61a..45612a9 100755
--- a/collection/strings
+++ b/collection/strings
@@ -60,7 +60,8 @@ foreach my $bin (keys %$file_info) {
     Lintian::Command::Simple::run ('mkdir', '-p', "$dir/strings/$elfdir") == 0
         or fail "Failed to create directory 'strings/$elfdir'";
 
-    spawn ({out => "$dir/strings/$bin", fail => 'error'}, ['strings', "$dir/unpacked/$bin"]);
+    spawn ({out => "$dir/strings/${bin}.gz", fail => 'error'},
+           ['strings', "$dir/unpacked/$bin"], '|', ['gzip', '-9c']);
 }
 
 close(ELF_INDEX) or fail("cannot write elf-index file: $!");
diff --git a/collection/strings.desc b/collection/strings.desc
index 0684294..1333f33 100644
--- a/collection/strings.desc
+++ b/collection/strings.desc
@@ -3,5 +3,5 @@ Author: Raphael Geissert <atomo64@gmail.com>
 Info: This script runs the strings(1) command over all files of a binary
  package.
 Type: binary, udeb
-Version: 1
+Version: 2
 Needs-Info: unpacked, file-info
diff --git a/debian/changelog b/debian/changelog
index 68dcfa4..daeb8b2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -111,6 +111,8 @@ lintian (2.5.7) UNRELEASED; urgency=low
     + [NT] Use Lintian::Collect to find ELF files.
     + [NT] Replace all usage of objdump with readelf.
       (Closes: #614034)
+  * collection/strings{,.desc}:
+    + [NT] Compress strings output and bump version of strings.
 
   * data:
     + [NT] Move to vendors/debian/ftp-master-auto-reject and replace
diff --git a/lib/Lintian/Collect/Binary.pm b/lib/Lintian/Collect/Binary.pm
index 4157b55..644a9f5 100644
--- a/lib/Lintian/Collect/Binary.pm
+++ b/lib/Lintian/Collect/Binary.pm
@@ -90,6 +90,19 @@ sub control_index {
     return $self->_fetch_index_data('control-index', 'control-index');
 }
 
+# Returns a handle with the strings in a given binary file (as computed
+# by coll/strings)
+#
+# If there are no strings for the given file, this method fails.
+#
+# sub strings Needs-Info strings
+sub strings {
+    my ($self, $file) = @_;
+    my $real = $self->_fetch_extracted_dir ('strings', 'strings', $file);
+    open my $fd, '-|', 'gzip', '-dc', "$real.gz" or fail "open ${file}.gz: $!";
+    return $fd;
+}
+
 # Returns the md5sums as calculated by the md5sums collection
 #  sub md5sums Needs-Info md5sums
 sub md5sums {
@@ -504,6 +517,11 @@ package.
 
 This is based on the package's description.
 
+=item strings (FILE)
+
+Returns an open handle, which will read the data from coll/strings for
+FILE.
+
 =back
 
 =head1 AUTHOR

-- 
Debian package checker


Reply to: