* 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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user