summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-12 08:41:29 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-12 08:41:29 +0000
commit3b1ad6f8182b02967444e01995c0433617c59eb9 (patch)
tree35be61651b33e2b0af65d3586fa7a62bb43f0db7
parentdb0300cda6025f5a2dad7f0457f3bfa926c7e39c (diff)
downloadportage-3b1ad6f8182b02967444e01995c0433617c59eb9.tar.gz
portage-3b1ad6f8182b02967444e01995c0433617c59eb9.tar.bz2
portage-3b1ad6f8182b02967444e01995c0433617c59eb9.zip
Logg errors that occur during binpkg extraction.
svn path=/main/trunk/; revision=15343
-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))]