From a5663a3fdc594c403452048b2c96fec33b0b8f9d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 4 Sep 2010 23:23:54 -0700 Subject: In AbstractEbuildProcess._start(), verify that PORTAGE_BUILDIR exists and bail out if necessary. --- pym/_emerge/AbstractEbuildProcess.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 61cd02fd8..28e783e08 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -44,6 +44,19 @@ class AbstractEbuildProcess(SpawnProcess): def _start(self): + # This can happen if the pre-clean phase triggers + # die_hooks for some reason, and PORTAGE_BUILDDIR + # doesn't exist yet. + if self.phase not in self._phases_without_builddir and \ + not os.path.isdir(self.settings['PORTAGE_BUILDDIR']): + msg = _("The ebuild phase '%s' has been aborted " + "since PORTAGE_BUILDIR does not exist: '%s'") % \ + (self.phase, self.settings['PORTAGE_BUILDDIR']) + self._eerror(textwrap.wrap(msg, 72)) + self._set_returncode((self.pid, 1)) + self.wait() + return + if self.background: # Automatically prevent color codes from showing up in logs, # since we're not displaying to a terminal anyway. -- cgit v1.2.3-1-g7c22