summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-11-14 03:30:52 +0000
committerZac Medico <zmedico@gentoo.org>2006-11-14 03:30:52 +0000
commitd66aff84fec2aa000616a421e429691f8d732a71 (patch)
tree03a3e8169599ab0060f791fec87c21413e50766e /pym
parentUse try/finally to ensure that locks are properly released in emergelog(). (diff)
downloadportage-multirepo-d66aff84fec2aa000616a421e429691f8d732a71.tar.gz
portage-multirepo-d66aff84fec2aa000616a421e429691f8d732a71.tar.bz2
portage-multirepo-d66aff84fec2aa000616a421e429691f8d732a71.zip
Use try/finally to ensure that locks are properly released in dblink.unmerge().
svn path=/main/trunk/; revision=5033
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 6baf2e55..9c4dc13e 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6381,9 +6381,6 @@ class dblink:
if not os.path.exists(self.dbcatdir):
os.makedirs(self.dbcatdir)
- # This blocks until we can get the dirs to ourselves.
- self.lockdb()
-
otherversions=[]
for v in self.vartree.dbapi.cp_list(self.mysplit[0]):
otherversions.append(v.split("/")[1])
@@ -6467,7 +6464,7 @@ class dblink:
if not self.getcontents():
self.unmerge(ldpath_mtimes=prev_mtimes)
self.delete()
- self.unlockdb()
+
print
print "Searching all installed packages for file collisions..."
print "Press Ctrl-C to Stop"
@@ -6615,7 +6612,6 @@ class dblink:
self.delete()
movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings)
contents = self.getcontents()
- self.unlockdb()
#write out our collection of md5sums
if cfgfiledict.has_key("IGNORE"):
@@ -6949,8 +6945,12 @@ class dblink:
def merge(self, mergeroot, inforoot, myroot, myebuild=None, cleanup=0,
mydbapi=None, prev_mtimes=None):
- return self.treewalk(mergeroot, myroot, inforoot, myebuild,
- cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
+ try:
+ self.lockdb()
+ return self.treewalk(mergeroot, myroot, inforoot, myebuild,
+ cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
+ finally:
+ self.unlockdb()
def getstring(self,name):
"returns contents of a file with whitespace converted to spaces"