myebuildpath = None
builddir_lock = None
+ log_path = None
scheduler = self._scheduler
retval = os.EX_OK
try:
- builddir_lock = EbuildBuildDir(
- scheduler=scheduler,
- settings=self.settings)
- builddir_lock.lock()
- prepare_build_dirs(settings=self.settings, cleanup=True)
- log_path = self.settings.get("PORTAGE_LOG_FILE")
if myebuildpath:
+ # Only create builddir_lock if doebuild_environment
+ # succeeded, since that's needed to initialize
+ # PORTAGE_BUILDDIR.
+ builddir_lock = EbuildBuildDir(
+ scheduler=scheduler,
+ settings=self.settings)
+ builddir_lock.lock()
+ prepare_build_dirs(settings=self.settings, cleanup=True)
+ log_path = self.settings.get("PORTAGE_LOG_FILE")
+
phase = EbuildPhase(background=background,
phase=ebuild_phase, scheduler=scheduler,
settings=self.settings)
self._elog_process(phasefilter=("prerm", "postrm"))
- if retval == os.EX_OK:
+ if retval == os.EX_OK and builddir_lock is not None:
# myebuildpath might be None, so ensure
# it has a sane value for the clean phase,
# even though it won't really be sourced.