summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/Binpkg.py9
-rw-r--r--pym/_emerge/BinpkgExtractorAsync.py8
2 files changed, 13 insertions, 4 deletions
diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 1e39d4861..a8d07630b 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -15,6 +15,7 @@ from portage import os
from portage import _encodings
from portage import _unicode_encode
import codecs
+import logging
from portage.output import colorize
class Binpkg(CompositeTask):
@@ -270,15 +271,17 @@ class Binpkg(CompositeTask):
extractor = BinpkgExtractorAsync(background=self.background,
image_dir=self._image_dir,
- pkg=self.pkg, pkg_path=self._pkg_path, scheduler=self.scheduler)
+ pkg=self.pkg, pkg_path=self._pkg_path,
+ logfile=self.settings.get("PORTAGE_LOG_FILE"),
+ scheduler=self.scheduler)
self._writemsg_level(">>> Extracting %s\n" % self.pkg.cpv)
self._start_task(extractor, self._extractor_exit)
def _extractor_exit(self, extractor):
if self._final_exit(extractor) != os.EX_OK:
self._unlock_builddir()
- writemsg("!!! Error Extracting '%s'\n" % self._pkg_path,
- noiselevel=-1)
+ self._writemsg_level("!!! Error Extracting '%s'\n" % \
+ self._pkg_path, noiselevel=-1, level=logging.ERROR)
self.wait()
def _unlock_builddir(self):
diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index ae9e7a58b..9e799443d 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -18,7 +18,13 @@ class BinpkgExtractorAsync(SpawnProcess):
def _start(self):
self.args = [self._shell_binary, "-c",
- "bzip2 -dqc -- %s | tar -xp -C %s -f -" % \
+ ("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \
+ "p=(${PIPESTATUS[@]}) ; " + \
+ "if [ ${p[0]} != 0 ] ; 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 ; " + \
+ "exit 0 ;") % \
(portage._shell_quote(self.pkg_path),
portage._shell_quote(self.image_dir))]