From dbe26095102cbdc6d5bef3509f05bc7b42c418cc Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 15 Jan 2013 12:09:21 -0800 Subject: 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. --- pym/_emerge/EbuildSpawnProcess.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pym/_emerge/EbuildSpawnProcess.py') diff --git a/pym/_emerge/EbuildSpawnProcess.py b/pym/_emerge/EbuildSpawnProcess.py index e1f682a66..26d26fc77 100644 --- a/pym/_emerge/EbuildSpawnProcess.py +++ b/pym/_emerge/EbuildSpawnProcess.py @@ -1,4 +1,4 @@ -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.AbstractEbuildProcess import AbstractEbuildProcess @@ -13,4 +13,10 @@ class EbuildSpawnProcess(AbstractEbuildProcess): __slots__ = ('fakeroot_state', 'spawn_func') def _spawn(self, args, **kwargs): - return self.spawn_func(args, env=self.settings.environ(), **kwargs) + + env = self.settings.environ() + + if self._dummy_pipe_fd is not None: + env["PORTAGE_PIPE_FD"] = str(self._dummy_pipe_fd) + + return self.spawn_func(args, env=env, **kwargs) -- cgit v1.2.3-1-g7c22