[Pkg-bazaar-commits] ./bzr-builddeb/trunk r346: Avoid problems due to SIGPIPE and subprocess

James Westby james.westby at canonical.com
Wed Jul 15 12:02:25 UTC 2009


------------------------------------------------------------
revno: 346
committer: James Westby <james.westby at canonical.com>
branch nick: trunk
timestamp: Wed 2009-07-15 13:02:25 +0100
message:
  Avoid problems due to SIGPIPE and subprocess
  
  This caused failures to uncompress some tarballs. Thanks to Colin Watson.
modified:
  debian/changelog
  source_distiller.py
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2009-07-04 20:47:57 +0000
+++ b/debian/changelog	2009-07-15 12:02:25 +0000
@@ -1,7 +1,16 @@
-bzr-builddeb (2.1.2~ubuntu2) jaunty; urgency=low
+bzr-builddeb (2.2~ubuntu1) jaunty; urgency=low
 
   [ James Westby ]
   * Don't remove the debian part of the version number twice. (LP: #372792)
+  * Make import-dsc work when the package contains a symlink.
+  * Also take file-ids from the upstream revision when doing an import-dsc.
+  * Fix a stupid error when recreating the tarball using pristine-tar.
+  * Add karmic to the list of releases.
+  * Several fixes for import-dsc when used in a multi-branch setting
+    (not possible from the command line).
+  * Don't deadlock when the pristine-tar delta is large.
+  * Avoid problems due to SIGPIPE and subprocess causing failures to
+    uncompress some tarballs. Thansk to Colin Watson (LP: #395353)
 
   [ Jelmer Vernooij ]
   * Support Vcs-Hg in the deb: directory service if bzr-hg is installed.

=== modified file 'source_distiller.py'
--- a/source_distiller.py	2009-03-04 13:05:56 +0000
+++ b/source_distiller.py	2009-07-15 12:02:25 +0000
@@ -20,6 +20,7 @@
 import glob
 import os
 import shutil
+import signal
 import subprocess
 import tempfile
 
@@ -35,6 +36,13 @@
         )
 
 
+def subprocess_setup():
+    # Python installs a SIGPIPE handler by default. This is usually not what
+    # non-Python subprocesses expect.
+    # Many, many thanks to Colin Watson
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+
 class SourceDistiller(object):
     """A source distiller extracts the source to build from a location.
 
@@ -124,7 +132,8 @@
             # Extract it to the right place
             tempdir = tempfile.mkdtemp(prefix='builddeb-merge-')
             try:
-                ret = subprocess.call(['tar','-C',tempdir,'-xf',tarball])
+                ret = subprocess.call(['tar','-C',tempdir,'-xf',tarball],
+                        preexec_fn=subprocess_setup)
                 if ret != 0:
                     raise TarFailed("uncompress", tarball)
                 files = glob.glob(tempdir+'/*')



More information about the Pkg-bazaar-commits mailing list