summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-19 01:58:27 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-19 01:58:27 -0700
commit237340c444298a346bf20e0d0ea718da9b708292 (patch)
tree4c8b17c89bfce79faac7581e71cd1d987abb235a /pym/_emerge
parent2c0cae31b23a34fb1aabc3f1df0e1f8b69867760 (diff)
downloadportage-237340c444298a346bf20e0d0ea718da9b708292.tar.gz
portage-237340c444298a346bf20e0d0ea718da9b708292.tar.bz2
portage-237340c444298a346bf20e0d0ea718da9b708292.zip
Move code from EbuildProcess to EbuildPhase.
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/EbuildPhase.py26
-rw-r--r--pym/_emerge/EbuildProcess.py22
2 files changed, 24 insertions, 24 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 98372eaf2..7fbc66849 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -9,7 +9,8 @@ from portage.util import writemsg, writemsg_stdout
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.package.ebuild.doebuild:_check_build_log,' + \
- '_post_phase_cmds,_post_src_install_chost_fix,' + \
+ '_post_phase_cmds,_post_phase_userpriv_perms,' + \
+ '_post_src_install_chost_fix,' + \
'_post_src_install_uid_fix'
)
from portage import os
@@ -45,8 +46,15 @@ class EbuildPhase(CompositeTask):
def _start_ebuild(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
+ # prevents the clean phase from removing $T.
+ logfile = self.settings.get("PORTAGE_LOG_FILE")
+ if self.phase in ("clean", "cleanrm"):
+ logfile = None
+
ebuild_process = EbuildProcess(actionmap=self.actionmap,
- background=self.background,
+ background=self.background, logfile=logfile,
phase=self.phase, scheduler=self.scheduler,
settings=self.settings)
@@ -54,6 +62,17 @@ class EbuildPhase(CompositeTask):
def _ebuild_exit(self, ebuild_process):
+ fail = False
+ if self._default_exit(ebuild_process) != os.EX_OK:
+ if self.phase == "test" and \
+ "test-fail-continue" in self.settings.features:
+ pass
+ else:
+ fail = True
+
+ if not fail:
+ self.returncode = None
+
if self.phase == "install":
out = portage.StringIO()
log_path = self.settings.get("PORTAGE_LOG_FILE")
@@ -75,11 +94,12 @@ class EbuildPhase(CompositeTask):
if log_file is not None:
log_file.close()
- if self._default_exit(ebuild_process) != os.EX_OK:
+ if fail:
self._die_hooks()
return
settings = self.settings
+ _post_phase_userpriv_perms(settings)
if self.phase == "install":
out = portage.StringIO()
diff --git a/pym/_emerge/EbuildProcess.py b/pym/_emerge/EbuildProcess.py
index 5ddbc68cc..ce97aff0f 100644
--- a/pym/_emerge/EbuildProcess.py
+++ b/pym/_emerge/EbuildProcess.py
@@ -4,23 +4,13 @@
from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
import portage
portage.proxy.lazyimport.lazyimport(globals(),
- 'portage.package.ebuild.doebuild:_post_phase_userpriv_perms,' + \
- '_spawn_actionmap,_doebuild_spawn'
+ 'portage.package.ebuild.doebuild:_doebuild_spawn,_spawn_actionmap'
)
-from portage import os
class EbuildProcess(AbstractEbuildProcess):
__slots__ = ('actionmap',)
- 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
- # prevents the clean phase from removing $T.
- if self.phase not in ("clean", "cleanrm"):
- self.logfile = self.settings.get("PORTAGE_LOG_FILE")
- AbstractEbuildProcess._start(self)
-
def _spawn(self, args, **kwargs):
actionmap = self.actionmap
@@ -29,13 +19,3 @@ class EbuildProcess(AbstractEbuildProcess):
return _doebuild_spawn(self.phase, self.settings,
actionmap=actionmap, **kwargs)
-
- def _set_returncode(self, wait_retval):
- AbstractEbuildProcess._set_returncode(self, wait_retval)
-
- if self.phase == "test" and self.returncode != os.EX_OK and \
- "test-fail-continue" in self.settings.features:
- self.returncode = os.EX_OK
-
- _post_phase_userpriv_perms(self.settings)
-