DON'T ASK ME HOW I FIXED THIS

This commit is contained in:
Eray Özkural
2006-03-24 14:19:32 +00:00
parent bbb0fe3abe
commit 43f33a65d0
2 changed files with 14 additions and 11 deletions
+12 -9
View File
@@ -142,24 +142,27 @@ class ItemByRepoDB(object):
self.d.put(name, s, txn)
self.d.txn_proc(proc, txn)
def remove_item(self, name, repo, txn = None):
def remove_item_repo(self, name, repo, txn = None):
name = str(name)
def proc(txn):
if repo:
s = self.d.get(name, txn)
else:
s, repo = self.get_item_repo(name, txn=txn)
repostr = self.repo_str(repo)
def p(txn):
s = self.d.get(name, txn)
repostr = self.repo_str(repo)
if s.has_key(repostr):
del s[repostr]
if (len(s)==0):
self.d.delete(name, txn)
else:
self.d.put(name, s, txn)
self.d.txn_proc(proc, txn)
self.d.txn_proc(p, txn)
def remove_item(self, name, txn = None):
def p(txn):
repo = self.which_repo(name, txn=txn)
self.remove_item_repo(name, repo, txn=txn)
self.d.txn_proc(p, txn)
def remove_repo(self, repo, txn = None):
def proc(txn):
for key in self.d.keys():
self.remove_item(key, repo, txn=txn)
self.remove_item_repo(key, repo, txn=txn)
self.d.txn_proc(proc, txn)
+2 -2
View File
@@ -84,9 +84,9 @@ class SourceDB(object):
def proc(txn):
assert self.has_spec(name, txn=txn)
spec = self.d.get_item_repo(name, repo, txn)
self.d.remove_item(name, repo, txn=txn)
self.d.remove_item(name, txn=txn)
for pkg in spec.packages:
self.dpkgtosrc.remove_item(pkg.name, name, repo, txn)
self.dpkgtosrc.remove_item_repo(pkg.name, name, repo, txn)
self.d.txn_proc(proc, txn)