For bug #154989, use a single lock on /var/db/pkg since finer grained locking is...
authorZac Medico <zmedico@gentoo.org>
Mon, 13 Nov 2006 23:52:04 +0000 (23:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 13 Nov 2006 23:52:04 +0000 (23:52 -0000)
svn path=/main/trunk/; revision=5027

pym/portage.py

index 13646b2fb54a6982ef3b0d70788eb1f019e910dc..3e7777ab889eab602fd1b9b51be83ac0a778e67c 100644 (file)
@@ -6024,8 +6024,7 @@ class dblink:
                self.dbtmpdir = self.dbcatdir+"/-MERGING-"+pkg
                self.dbdir    = self.dbpkgdir
 
-               self.lock_pkg = None
-               self.lock_tmp = None
+               self._lock_vdb = None
                self.lock_num = 0    # Count of the held locks on the db.
 
                self.settings = mysettings
@@ -6043,15 +6042,13 @@ class dblink:
 
        def lockdb(self):
                if self.lock_num == 0:
-                       self.lock_pkg = portage_locks.lockdir(self.dbpkgdir)
-                       self.lock_tmp = portage_locks.lockdir(self.dbtmpdir)
+                       self._lock_vdb = portage_locks.lockdir(self.dbroot)
                self.lock_num += 1
 
        def unlockdb(self):
                self.lock_num -= 1
                if self.lock_num == 0:
-                       portage_locks.unlockdir(self.lock_tmp)
-                       portage_locks.unlockdir(self.lock_pkg)
+                       portage_locks.unlockdir(self._lock_vdb)
 
        def getpath(self):
                "return path to location of db information (for >>> informational display)"