* implement forgotten removal of repo from sourcedb

when a repo is removed
* fix: delete empty entries after removal of a repo
This commit is contained in:
Eray Özkural
2006-03-23 12:39:42 +00:00
parent 4bb11adcb8
commit a858f077d1
3 changed files with 9 additions and 6 deletions
+2 -6
View File
@@ -143,7 +143,6 @@ class ItemByRepoDB(object):
def remove_item(self, name, repo, txn = None):
name = str(name)
repo = str(repo)
def proc(txn):
s = self.d.get(name, txn)
repostr = self.repo_str(repo)
@@ -157,9 +156,6 @@ class ItemByRepoDB(object):
def remove_repo(self, repo, txn = None):
def proc(txn):
repostr = self.repo_str(repo)
for (key, s) in self.d.items():
if s.has_key(repostr):
del s[repostr]
self.d.put(repo, s, txn)
for key in self.d.keys():
self.remove_item(key, repo, txn=txn)
self.d.txn_proc(proc, txn)
+1
View File
@@ -99,6 +99,7 @@ class RepoDB(object):
list.remove(name)
self.d.put("order", list, txn)
ctx.packagedb.remove_repo(name, txn=txn)
ctx.sourcedb.remove_repo(name, txn=txn)
self.d.txn_proc(proc, txn)
db = None
+6
View File
@@ -90,6 +90,12 @@ class SourceDB(object):
self.d.txn_proc(proc, txn)
def remove_repo(self, repo, txn = None):
def proc(txn):
self.d.remove_repo(repo, txn=txn)
self.dpkgtosrc.remove_repo(repo, txn=txn)
self.d.txn_proc(proc, txn)
sourcedb = None
def init():