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

[SCM] Debian package checker branch, master, updated. 2.5.13-12-g6f4bd2f



The following commit has been merged in the master branch:
commit 6f4bd2fee21770baa7dda96ce281b70560e4c560
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Jun 12 09:55:11 2013 +0200

    coll/file-info: Pass "-e ascii" to file(1)
    
    Disable the file "ascii" test.  A quick test suggests that -e ascii
    reduces the runtime of file-info on source:linux by about 100s
    (117s -> 20s).  Since nothing in Lintian currently relies on this
    file(1) test, disabling it is simply a "free optimization".
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/collection/file-info b/collection/file-info
index ec85265..907dd03 100755
--- a/collection/file-info
+++ b/collection/file-info
@@ -56,7 +56,7 @@ chdir("$dir/unpacked");
 my %opts = ( pipe_in => FileHandle->new,
              out => $outfile,
              fail => 'never' );
-spawn(\%opts, ['xargs', '-0r', 'file', '-NF', '', '--print0', '--'], '|', [$helper], '|', ['gzip', '--best', '-c']);
+spawn(\%opts, ['xargs', '-0r', 'file', '-e', 'ascii', '-NF', '', '--print0', '--'], '|', [$helper], '|', ['gzip', '--best', '-c']);
 $opts{pipe_in}->blocking(1);
 
 foreach my $file ($info->sorted_index) {
diff --git a/collection/file-info.desc b/collection/file-info.desc
index 712ac47..a12601d 100644
--- a/collection/file-info.desc
+++ b/collection/file-info.desc
@@ -2,6 +2,6 @@ Collector-Script: file-info
 Author: Richard Braakman <dark@xs4all.nl>
 Info: This script runs the file(1) command over all files of any kind of package.
 Type: binary, udeb, source
-Version: 2
+Version: 3
 Needs-Info: unpacked, index
 Interface: perl-coll
diff --git a/debian/changelog b/debian/changelog
index 51b179c..c9edaad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ lintian (2.5.14) UNRELEASED; urgency=low
       reduce the "inode pressure" on lintian.d.o.
   * coll/debfiles:
     + [NT] Remove test of the presence of unpacked.
+  * coll/file-info{,.desc}:
+    + [NT] Disable "ascii" test in file(1).  For some packages this
+      may greatly reduce the overhead of running the file-info
+      collection.
   * coll/hardening-info:
     + [NT] Skip files in usr/lib/debug/.
 
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index 2a17a71..fe2a16d 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -141,7 +141,11 @@ sub unpacked {
 
 =item file_info (FILE)
 
-Returns the output of file(1) for FILE (if it exists) or C<undef>.
+Returns the output of file(1) -e ascii for FILE (if it exists) or
+C<undef>.
+
+B<CAVEAT>: As file(1) is passed "-e ascii", all text files will be
+considered "data" rather than "text", "Java code" etc.
 
 NB: The value may have been calibrated by Lintian.  A notorious example
 is gzip files, where file(1) can be unreliable at times (see #620289)

-- 
Debian package checker


Reply to: