Fix UnboundLocalError for catdir inside dblink.unmerge().
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 22:16:10 +0000 (15:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Aug 2010 22:16:10 +0000 (15:16 -0700)
pym/portage/dbapi/vartree.py

index a804652bce5aaf6757812f9ed8deba49b2383999..f986c0a3c97046cf16565f5bbbdd30a7af46fef0 100644 (file)
@@ -2175,6 +2175,7 @@ class dblink(object):
                myebuildpath = None
                ebuild_phase = "prerm"
                log_path = None
+               catdir = None
                mystuff = os.listdir(self.dbdir)
                for x in mystuff:
                        if x.endswith(".ebuild"):
@@ -2345,7 +2346,7 @@ class dblink(object):
                                finally:
                                        unlockdir(builddir_lock)
                        try:
-                               if not catdir_lock:
+                               if catdir and not catdir_lock:
                                        # Lock catdir for removal if empty.
                                        catdir_lock = lockdir(catdir)
                        finally: