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

[SCM] Debian package checker branch, master, updated. 2.2.18-46-g24007ec



The following commit has been merged in the master branch:
commit 24007ecb93f64a147540248740b65ba2ad2f5387
Author: Russ Allbery <rra@debian.org>
Date:   Thu Dec 24 14:24:31 2009 -0800

    Report errors when unpacking packages
    
    * unpack/unpack-binpkg-l2:
      + [RA] Report errors from dpkg-deb or tar on stderr if either exit
        with non-zero status.
    * unpack/unpack-srcpkg-l2:
      + [RA] Report errors from dpkg-source -x on stderr if it exits with
        non-zero status.  (Closes: #557717)

diff --git a/debian/changelog b/debian/changelog
index 88828c6..e985d73 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -117,6 +117,13 @@ lintian (2.3.0) UNRELEASED; urgency=low
     + [RA] Suppress checking the syntax of the lintian output if neither
       Test-For nor Test-Against are set and Sort: no is set.
 
+  * unpack/unpack-binpkg-l2:
+    + [RA] Report errors from dpkg-deb or tar on stderr if either exit
+      with non-zero status.
+  * unpack/unpack-srcpkg-l2:
+    + [RA] Report errors from dpkg-source -x on stderr if it exits with
+      non-zero status.  (Closes: #557717)
+
  -- Russ Allbery <rra@debian.org>  Mon, 23 Nov 2009 02:20:29 -0800
 
 lintian (2.2.18) unstable; urgency=low
diff --git a/unpack/unpack-binpkg-l2 b/unpack/unpack-binpkg-l2
index 78d3184..0305338 100755
--- a/unpack/unpack-binpkg-l2
+++ b/unpack/unpack-binpkg-l2
@@ -32,15 +32,22 @@ use Lintian::Command qw(spawn);
 use Util;
 
 print "N: Unpacking binary packages in directory $base_dir ...\n" if $verbose;
-mkdir("$base_dir/unpacked", 0777) or fail();
+mkdir("$base_dir/unpacked", 0777) or fail("mkdir $base_dir/unpacked: $!");
 
 # avoid using dpkg-deb -x; this pipeline is far faster.  I got a factor 2
-# improvement on large debs, and factor 1.5 on small debs.  I heard
-# it's because dpkg-deb syncs while writing.  -- Richard
-
-spawn({ fail => 'error', err => "$base_dir/unpacked-errors" },
+# improvement on large debs, and factor 1.5 on small debs.  I heard it's
+# because dpkg-deb syncs while writing.  -- Richard
+my $opts = { err => "$base_dir/unpacked-errors" };
+spawn($opts,
       ['dpkg-deb', '--fsys-tarfile', "$base_dir/deb"],
       '|', ['tar', 'xf', '-', '-C', "$base_dir/unpacked"]);
+unless ($opts->{success}) {
+    open(ERRORS, '<', "$base_dir/unpacked-errors")
+        or fail("cannot open $base_dir/unpacked-errors: $!");
+    print STDERR while <ERRORS>;
+    close ERRORS;
+    fail("dpkg-deb | tar failed with status ", $opts->{harness}->result);
+}
 
 # fix permissions
 spawn({ fail => 'error' },
diff --git a/unpack/unpack-srcpkg-l2 b/unpack/unpack-srcpkg-l2
index ec8263a..dbd571b 100755
--- a/unpack/unpack-srcpkg-l2
+++ b/unpack/unpack-srcpkg-l2
@@ -36,8 +36,14 @@ chdir($base_dir);
 
 # Ignore STDOUT of the child process because older versions of dpkg-source
 # print things out even with -q.
-spawn({ fail => 'error', out => '/dev/null', err => 'unpacked-errors' },
-      ['dpkg-source', '-q', '-x', 'dsc', 'unpacked']);
+my $opts = { out => '/dev/null', err => 'unpacked-errors' };
+unless (spawn($opts, ['dpkg-source', '-q', '-x', 'dsc', 'unpacked'])) {
+    open(ERRORS, '<', 'unpacked-errors')
+        or fail("cannot open unpacked-errors: $!");
+    print STDERR while <ERRORS>;
+    close ERRORS;
+    fail("dpkg-source -x failed with status ", $opts->{harness}->result);
+}
 
 # fix permissions
 spawn({ fail => 'error' },

-- 
Debian package checker


Reply to: