From: Zac Medico Date: Sun, 27 Mar 2011 20:57:35 +0000 (-0700) Subject: unmerge: fix lock/UnsupportedAPIException logic X-Git-Tag: v2.2.0_alpha29~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a46057efe4782553e8e292759c6153b27e4b4fe9;p=portage.git unmerge: fix lock/UnsupportedAPIException logic --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index dd041d895..afcbdc9d7 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1544,16 +1544,21 @@ class dblink(object): 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) @@ -1668,7 +1673,7 @@ class dblink(object): 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.