From 50daef1ab961c42a3352281e915da5a89297e3a9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Aug 2010 20:55:11 -0700 Subject: Bug #335340 - Add support for PORTAGE_BZIP2_COMMAND and PORTAGE_BUNZIP2_COMMAND settings in make.conf. This only adds support for binary packages, since that's where pbzip2 can provide the most benefit in common cases. --- pym/_emerge/Binpkg.py | 1 + pym/_emerge/BinpkgEnvExtractor.py | 2 +- pym/_emerge/BinpkgExtractorAsync.py | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'pym/_emerge') diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py index cfb32ad5d..ac9a68a0f 100644 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@ -274,6 +274,7 @@ class Binpkg(CompositeTask): return extractor = BinpkgExtractorAsync(background=self.background, + env=self.settings.environ(), image_dir=self._image_dir, pkg=self.pkg, pkg_path=self._pkg_path, logfile=self.settings.get("PORTAGE_LOG_FILE"), diff --git a/pym/_emerge/BinpkgEnvExtractor.py b/pym/_emerge/BinpkgEnvExtractor.py index 77060589a..f68971b35 100644 --- a/pym/_emerge/BinpkgEnvExtractor.py +++ b/pym/_emerge/BinpkgEnvExtractor.py @@ -30,7 +30,7 @@ class BinpkgEnvExtractor(CompositeTask): def _start(self): saved_env_path = self._get_saved_env_path() dest_env_path = self._get_dest_env_path() - shell_cmd = "bzip2 -dc %s > %s" % \ + shell_cmd = "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- %s > %s" % \ (_shell_quote(saved_env_path), _shell_quote(dest_env_path)) extractor_proc = SpawnProcess( diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py index a2bbe7a45..004544e92 100644 --- a/pym/_emerge/BinpkgExtractorAsync.py +++ b/pym/_emerge/BinpkgExtractorAsync.py @@ -16,7 +16,7 @@ class BinpkgExtractorAsync(SpawnProcess): # 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 - ; " + \ + ("${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- %s | tar -xp -C %s -f - ; " + \ "p=(${PIPESTATUS[@]}) ; " + \ "if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \ "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \ @@ -26,5 +26,4 @@ class BinpkgExtractorAsync(SpawnProcess): (portage._shell_quote(self.pkg_path), portage._shell_quote(self.image_dir))] - self.env = os.environ.copy() SpawnProcess._start(self) -- cgit v1.2.3-1-g7c22