unmerge: remove redundant builddir_locked var
authorZac Medico <zmedico@gentoo.org>
Fri, 27 May 2011 00:00:22 +0000 (17:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 May 2011 00:00:22 +0000 (17:00 -0700)
pym/portage/dbapi/vartree.py

index 976d8e37261ee442c2e0748b0454ebddd481d638..982324c2ce43e36754e73011f25a4a396a7a6f28 100644 (file)
@@ -1684,19 +1684,17 @@ class dblink(object):
                self._prune_plib_registry(unmerge=True, needed=needed,
                        preserve_paths=preserve_paths)
 
-               builddir_locked = "PORTAGE_BUILDIR_LOCKED" in self.settings
                builddir_lock = None
                scheduler = self._scheduler
                retval = os.EX_OK
                try:
                        # Only create builddir_lock if the caller
                        # has not already acquired the lock.
-                       if not builddir_locked:
+                       if "PORTAGE_BUILDIR_LOCKED" not in self.settings:
                                builddir_lock = EbuildBuildDir(
                                        scheduler=scheduler,
                                        settings=self.settings)
                                builddir_lock.lock()
-                               builddir_locked = True
                                prepare_build_dirs(settings=self.settings, cleanup=True)
                                log_path = self.settings.get("PORTAGE_LOG_FILE")
 
@@ -1746,8 +1744,7 @@ class dblink(object):
 
                finally:
                        self.vartree.dbapi._bump_mtime(self.mycpv)
-                       if builddir_locked:
-                               try:
+                       try:
                                        if not eapi_unsupported and os.path.isfile(myebuildpath):
                                                if retval != os.EX_OK:
                                                        msg_lines = []
@@ -1789,7 +1786,7 @@ class dblink(object):
 
                                        self._elog_process(phasefilter=("prerm", "postrm"))
 
-                                       if retval == os.EX_OK and builddir_locked:
+                                       if retval == os.EX_OK:
                                                try:
                                                        doebuild_environment(myebuildpath, "cleanrm",
                                                                settings=self.settings, db=self.vartree.dbapi)
@@ -1800,7 +1797,7 @@ class dblink(object):
                                                        settings=self.settings)
                                                phase.start()
                                                retval = phase.wait()
-                               finally:
+                       finally:
                                        if builddir_lock is not None:
                                                builddir_lock.unlock()