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

[SCM] Debian package checker branch, master, updated. 2.2.18-8-g318519a



The following commit has been merged in the master branch:
commit 318519a27dcad588d2bc929256b558274ce4184d
Author: Russ Allbery <rra@debian.org>
Date:   Sun Dec 20 14:40:19 2009 -0800

    Consume all control file output before closing the pipe
    
    * lib/Util.pm:
      + [RA] Consume all output from extracting the control file of a binary
        package before closing the pipe.

diff --git a/debian/changelog b/debian/changelog
index a2c2f08..9d30443 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,9 @@ lintian (2.2.19) UNRELEASED; urgency=low
 
   * lib/Tags.pm:
     + [RA] Support suppressing a list of tags.
+  * lib/Util.pm:
+    + [RA] Consume all output from extracting the control file of a binary
+      package before closing the pipe.
 
   * man/lintian.1:
     + [RA] Document --suppress-tags and --suppress-tags-from-file.
diff --git a/lib/Util.pm b/lib/Util.pm
index cb57e94..c8bea34 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -156,13 +156,18 @@ sub get_deb_info {
 	return undef;
     }
 
-    # `dpkg-deb -f $file' is very slow. Instead, we use ar and tar.
+    # dpkg-deb -f $file is very slow. Instead, we use ar and tar.
     my $opts = { pipe_out => FileHandle->new };
     spawn($opts,
 	  ['ar', 'p', $file, 'control.tar.gz'],
 	  '|', ['tar', '--wildcards', '-xzO', '-f', '-', '*control'])
 	or fail("cannot fork to unpack $file: $opts->{exception}\n");
     my @data = parse_dpkg_control($opts->{pipe_out});
+
+    # Consume all data before exiting so that we don't kill child processes
+    # with SIGPIPE.  This will normally only be an issue with malformed
+    # control files.
+    1 while readline $opts->{pipe_out};
     $opts->{harness}->finish();
     return $data[0];
 }

-- 
Debian package checker


Reply to: