From 9977cd5dfe5143d13becf3e39baaf141685a23d7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 7 Sep 2010 16:56:49 -0700 Subject: Move the stale elog cleanup code from AbstractEbuildProcess to EbuildPhase. --- pym/_emerge/AbstractEbuildProcess.py | 14 -------------- pym/_emerge/EbuildPhase.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index a74a39437..ed20b14f9 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -59,20 +59,6 @@ class AbstractEbuildProcess(SpawnProcess): self.wait() return - if need_builddir: - phase_completed_file = os.path.join( - self.settings['PORTAGE_BUILDDIR'], - ".%sed" % self.phase.rstrip('e')) - if not os.path.exists(phase_completed_file): - # If the phase is really going to run then we want - # to eliminate any stale elog messages that may - # exist from a previous run. - try: - os.unlink(os.path.join(self.settings['T'], - 'logging', self.phase)) - except OSError: - pass - if self.background: # Automatically prevent color codes from showing up in logs, # since we're not displaying to a terminal anyway. diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py index 117471335..9eabb3402 100644 --- a/pym/_emerge/EbuildPhase.py +++ b/pym/_emerge/EbuildPhase.py @@ -30,6 +30,22 @@ class EbuildPhase(CompositeTask): def _start(self): + need_builddir = self.phase not in EbuildProcess._phases_without_builddir + + if need_builddir: + phase_completed_file = os.path.join( + self.settings['PORTAGE_BUILDDIR'], + ".%sed" % self.phase.rstrip('e')) + if not os.path.exists(phase_completed_file): + # If the phase is really going to run then we want + # to eliminate any stale elog messages that may + # exist from a previous run. + try: + os.unlink(os.path.join(self.settings['T'], + 'logging', self.phase)) + except OSError: + pass + if self.phase == 'setup': use = self.settings.get('PORTAGE_BUILT_USE') -- cgit v1.2.3-1-g7c22