summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/MiscFunctionsProcess.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-15 12:09:21 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-15 12:09:21 -0800
commitdbe26095102cbdc6d5bef3509f05bc7b42c418cc (patch)
treefbdc5d18ff9fa33dc7b69fdb6c173312cb4507a8 /pym/_emerge/MiscFunctionsProcess.py
parent7c624515d0bb106c8a468addff5df153cebf31fc (diff)
downloadportage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.gz
portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.bz2
portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.zip
SpawnProcess: improve dummy pipe allocation logic
By using allocated file descriptors for keys in fd_pipes, we naturally avoid interference with callers such as FileDigester and MergeProcess. See the _setup_pipes docstring for more benefits of this allocation approach.
Diffstat (limited to 'pym/_emerge/MiscFunctionsProcess.py')
-rw-r--r--pym/_emerge/MiscFunctionsProcess.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/_emerge/MiscFunctionsProcess.py b/pym/_emerge/MiscFunctionsProcess.py
index afa44fb2a..bada79d86 100644
--- a/pym/_emerge/MiscFunctionsProcess.py
+++ b/pym/_emerge/MiscFunctionsProcess.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
@@ -29,6 +29,10 @@ class MiscFunctionsProcess(AbstractEbuildProcess):
AbstractEbuildProcess._start(self)
def _spawn(self, args, **kwargs):
+
+ if self._dummy_pipe_fd is not None:
+ self.settings["PORTAGE_PIPE_FD"] = str(self._dummy_pipe_fd)
+
# Temporarily unset EBUILD_PHASE so that bashrc code doesn't
# think this is a real phase.
phase_backup = self.settings.pop("EBUILD_PHASE", None)
@@ -37,3 +41,4 @@ class MiscFunctionsProcess(AbstractEbuildProcess):
finally:
if phase_backup is not None:
self.settings["EBUILD_PHASE"] = phase_backup
+ self.settings.pop("PORTAGE_PIPE_FD", None)