From: Zac Medico Date: Tue, 2 Mar 2010 20:12:58 +0000 (-0000) Subject: Logg errors that occur during binpkg extraction. (trunk r15343) X-Git-Tag: v2.1.8~152 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=47378f7c076cdfd62b6a6ca5ad80f8ba8acf89c7;p=portage.git Logg errors that occur during binpkg extraction. (trunk r15343) svn path=/main/branches/2.1.7/; revision=15570 --- 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))]