diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-25 18:26:15 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-25 18:26:15 -0700 |
commit | 07de48f66fc63bb747111af4ae6ad8fe53e9fe26 (patch) | |
tree | 2264d62f0b3be033a14aff1b4b578fe53b6bc30d /pym/_emerge/BinpkgExtractorAsync.py | |
parent | fb502ea2ad6bd0445b9e0266a862a106b35dbc34 (diff) | |
download | portage-07de48f66fc63bb747111af4ae6ad8fe53e9fe26.tar.gz portage-07de48f66fc63bb747111af4ae6ad8fe53e9fe26.tar.bz2 portage-07de48f66fc63bb747111af4ae6ad8fe53e9fe26.zip |
Use a PORTAGE_SIGPIPE_STATUS variable to export 128 + SIGPIPE to the
ebuild environment. SIGPIPE is typically 13, but its better not to
assume that.
Diffstat (limited to 'pym/_emerge/BinpkgExtractorAsync.py')
-rw-r--r-- | pym/_emerge/BinpkgExtractorAsync.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py index 3a2654ec1..a2bbe7a45 100644 --- a/pym/_emerge/BinpkgExtractorAsync.py +++ b/pym/_emerge/BinpkgExtractorAsync.py @@ -1,9 +1,10 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.SpawnProcess import SpawnProcess import portage import os +import signal class BinpkgExtractorAsync(SpawnProcess): @@ -12,12 +13,12 @@ class BinpkgExtractorAsync(SpawnProcess): _shell_binary = portage.const.BASH_BINARY def _start(self): - # SIGPIPE handling (status 141) should be compatible with + # SIGPIPE handling (128 + SIGPIPE) 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 && ${p[0]} != 141 ]] ; then " + \ + "if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \ "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 ; " + \ |