from portage import _encodings
from portage import _unicode_encode
import codecs
+import logging
from portage.output import colorize
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):
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))]