Move the stale elog cleanup code from AbstractEbuildProcess to
authorZac Medico <zmedico@gentoo.org>
Tue, 7 Sep 2010 23:56:49 +0000 (16:56 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 7 Sep 2010 23:56:49 +0000 (16:56 -0700)
EbuildPhase.

pym/_emerge/AbstractEbuildProcess.py
pym/_emerge/EbuildPhase.py

index a74a39437250c753bb593d27588c397f6d59a7e5..ed20b14f92c61096bddd0edaee73f1c6ce05bb0c 100644 (file)
@@ -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.
index 1174713352dabcb84f7361e648184a244f671f32..9eabb340223d484571615bfc0a0f816c5e70a600 100644 (file)
@@ -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')