summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-17 01:22:58 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-17 01:22:58 -0700
commit71e9c8caf63805b8350c215ee27070d465115eee (patch)
tree289be66bc99eff6924890f862151a94369b619dd
parentada254e2d18f4ba7a2ea8c9a44cef180af1ba9da (diff)
downloadportage-71e9c8caf63805b8350c215ee27070d465115eee.tar.gz
portage-71e9c8caf63805b8350c215ee27070d465115eee.tar.bz2
portage-71e9c8caf63805b8350c215ee27070d465115eee.zip
Fix _spawn_phase() to spawn phases without sandbox when necessary.
-rw-r--r--pym/_emerge/EbuildProcess.py10
-rw-r--r--pym/portage/package/ebuild/doebuild.py9
2 files changed, 11 insertions, 8 deletions
diff --git a/pym/_emerge/EbuildProcess.py b/pym/_emerge/EbuildProcess.py
index 50edaa16d..70c724314 100644
--- a/pym/_emerge/EbuildProcess.py
+++ b/pym/_emerge/EbuildProcess.py
@@ -5,7 +5,7 @@ from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.package.ebuild.doebuild:_post_phase_userpriv_perms,' + \
- '_spawn_actionmap,spawn@doebuild_spawn'
+ '_spawn_actionmap,_unsandboxed_phases,spawn@doebuild_spawn'
)
from portage import _shell_quote
from portage import os
@@ -15,12 +15,6 @@ class EbuildProcess(AbstractEbuildProcess):
__slots__ = ('actionmap',)
- _unsandboxed_phases = frozenset([
- "clean", "cleanrm", "config",
- "help", "info", "postinst",
- "preinst", "pretend", "postrm",
- "prerm", "setup"])
-
def _start(self):
# Don't open the log file during the clean phase since the
# open file can result in an nfs lock on $T/build.log which
@@ -31,7 +25,7 @@ class EbuildProcess(AbstractEbuildProcess):
def _spawn(self, args, **kwargs):
self.settings["EBUILD_PHASE"] = self.phase
- if self.phase in self._unsandboxed_phases:
+ if self.phase in _unsandboxed_phases:
kwargs['free'] = True
if self.phase == 'depend':
kwargs['droppriv'] = 'userpriv' in self.settings.features
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 195bfdd4f..355088036 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -55,6 +55,13 @@ from _emerge.EbuildPhase import EbuildPhase
from _emerge.EbuildSpawnProcess import EbuildSpawnProcess
from _emerge.TaskScheduler import TaskScheduler
+_unsandboxed_phases = frozenset([
+ "clean", "cleanrm", "config",
+ "help", "info", "postinst",
+ "preinst", "pretend", "postrm",
+ "prerm", "setup"
+])
+
def doebuild_environment(myebuild, mydo, myroot, mysettings,
debug, use_cache, mydbapi):
@@ -1074,6 +1081,8 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
def _spawn_phase(phase, settings, **kwargs):
if kwargs.get('returnpid'):
+ if phase in _unsandboxed_phases:
+ kwargs['free'] = True
portage_bin_path = settings["PORTAGE_BIN_PATH"]
ebuild_sh_binary = os.path.join(portage_bin_path,
os.path.basename(EBUILD_SH_BINARY))