From 237340c444298a346bf20e0d0ea718da9b708292 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 19 Aug 2010 01:58:27 -0700 Subject: Move code from EbuildProcess to EbuildPhase. --- pym/_emerge/EbuildPhase.py | 26 +++++++++++++++++++++++--- pym/_emerge/EbuildProcess.py | 22 +--------------------- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'pym/_emerge') 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) - -- cgit v1.2.3-1-g7c22