summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/BinpkgExtractorAsync.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-23 17:57:48 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-23 17:57:48 -0700
commit0ab6f83070c9a32a24454053319c99559c2654ca (patch)
tree02691a5ce6da1bfeb67761571f46c47e2b4161a1 /pym/_emerge/BinpkgExtractorAsync.py
parent3359e0116b4e592b28ac0f24fed6a1e2eabe6bf6 (diff)
downloadportage-0ab6f83070c9a32a24454053319c99559c2654ca.tar.gz
portage-0ab6f83070c9a32a24454053319c99559c2654ca.tar.bz2
portage-0ab6f83070c9a32a24454053319c99559c2654ca.zip
Handle SIGPIPE when unpack() extracts tar files through a pipe (bug #309001).
When checking ${PIPESTATUS[@]} for extraction of tar files in unpack(), use a new assert_sigpipe_ok() function which behaves the same as the existing assert() function except that it tolerates pipe writers being killed by SIGPIPE.
Diffstat (limited to 'pym/_emerge/BinpkgExtractorAsync.py')
-rw-r--r--pym/_emerge/BinpkgExtractorAsync.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index a4941fccf..3a2654ec1 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -12,10 +12,12 @@ class BinpkgExtractorAsync(SpawnProcess):
_shell_binary = portage.const.BASH_BINARY
def _start(self):
+ # SIGPIPE handling (status 141) should be compatible with
+ # assert_sigpipe_ok() that's used by the ebuild unpack() helper.
self.args = [self._shell_binary, "-c",
("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \
"p=(${PIPESTATUS[@]}) ; " + \
- "if [ ${p[0]} != 0 ] ; then " + \
+ "if [[ ${p[0]} != 0 && ${p[0]} != 141 ]] ; then " + \
"echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
"if [ ${p[1]} != 0 ] ; then " + \
"echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \