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

[SCM] Debian package checker branch, master, updated. 2.2.8-19-g45597f1



The following commit has been merged in the master branch:
commit 45597f1c3ba117b4338e28b5b917cf0cdb297c2a
Author: Russ Allbery <rra@debian.org>
Date:   Fri Apr 3 11:17:50 2009 -0700

    Ignore error returns from file
    
    * collection/file-info:
      + [RA] Ignore error returns from file.  file returns non-zero if it
        can't parse some files, but the resulting output is still fine for
        Lintian's purposes.  Thanks to Raphael Geissert for the problem
        identification.  (Closes: #521257)

diff --git a/collection/file-info b/collection/file-info
index 39155f6..26ce743 100755
--- a/collection/file-info
+++ b/collection/file-info
@@ -2,17 +2,17 @@
 # file-info -- lintian collection script
 
 # Copyright (C) 1998 Richard Braakman
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, you can find it on the World Wide
 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
@@ -36,10 +36,13 @@ unlink("file-info");
 chdir("unpacked")
     or fail("cannot chdir to unpacked directory: $!");
 
-
+# We ignore failures from file because sometimes file returns a non-zero exit
+# status when it can't parse a file.  So far, the resulting output still
+# appears to be usable (although will contain "ERROR" strings, which Lintian
+# doesn't care about), and the only problem was the exit status.
 my %opts = ( pipe_in => FileHandle->new,
 	     out => '../file-info',
-	     fail => 'error' );
+	     fail => 'never' );
 spawn(\%opts, ['xargs', '-0r', 'file']);
 $opts{pipe_in}->blocking(1);
 open(INDEX, '<', "../index")
diff --git a/debian/changelog b/debian/changelog
index f7d8a5a..2105366 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,10 @@ lintian (2.2.9) UNRELEASED; urgency=low
 
   * collection/file-info:
     + [RA] Use chomp instead of chop to remove newlines.
+    + [RA] Ignore error returns from file.  file returns non-zero if it
+      can't parse some files, but the resulting output is still fine for
+      Lintian's purposes.  Thanks to Raphael Geissert for the problem
+      identification.  (Closes: #521257)
 
   * data/changelog-file/ubuntu-dists:
     + [CW] Add karmic as an allowable distribution for Ubuntu (thanks, Soren
diff --git a/t/tests/file-info-errors/debian/README b/t/tests/file-info-errors/debian/README
new file mode 100644
index 0000000..8ded722
--- /dev/null
+++ b/t/tests/file-info-errors/debian/README
@@ -0,0 +1 @@
+File taken from clamav 0.94.dfsg.2.  Causes errors with file 5.00.
diff --git a/t/tests/file-info-errors/debian/split.clam.ole.docaa b/t/tests/file-info-errors/debian/split.clam.ole.docaa
new file mode 100644
index 0000000..2e59330
Binary files /dev/null and b/t/tests/file-info-errors/debian/split.clam.ole.docaa differ
diff --git a/t/tests/file-info-errors/desc b/t/tests/file-info-errors/desc
new file mode 100644
index 0000000..f3ef7ca
--- /dev/null
+++ b/t/tests/file-info-errors/desc
@@ -0,0 +1,4 @@
+Testname: file-info-errors
+Sequence: 4500
+Version: 1.0
+Description: Test handling of errors from file
diff --git a/t/debs/description-synopsis-spaces/tags b/t/tests/file-info-errors/tags
similarity index 100%
copy from t/debs/description-synopsis-spaces/tags
copy to t/tests/file-info-errors/tags

-- 
Debian package checker


Reply to: