* 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):
|
def remove_item(self, name, repo, txn = None):
|
||||||
name = str(name)
|
name = str(name)
|
||||||
repo = str(repo)
|
|
||||||
def proc(txn):
|
def proc(txn):
|
||||||
s = self.d.get(name, txn)
|
s = self.d.get(name, txn)
|
||||||
repostr = self.repo_str(repo)
|
repostr = self.repo_str(repo)
|
||||||
@@ -157,9 +156,6 @@ class ItemByRepoDB(object):
|
|||||||
|
|
||||||
def remove_repo(self, repo, txn = None):
|
def remove_repo(self, repo, txn = None):
|
||||||
def proc(txn):
|
def proc(txn):
|
||||||
repostr = self.repo_str(repo)
|
for key in self.d.keys():
|
||||||
for (key, s) in self.d.items():
|
self.remove_item(key, repo, txn=txn)
|
||||||
if s.has_key(repostr):
|
|
||||||
del s[repostr]
|
|
||||||
self.d.put(repo, s, txn)
|
|
||||||
self.d.txn_proc(proc, txn)
|
self.d.txn_proc(proc, txn)
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ class RepoDB(object):
|
|||||||
list.remove(name)
|
list.remove(name)
|
||||||
self.d.put("order", list, txn)
|
self.d.put("order", list, txn)
|
||||||
ctx.packagedb.remove_repo(name, txn=txn)
|
ctx.packagedb.remove_repo(name, txn=txn)
|
||||||
|
ctx.sourcedb.remove_repo(name, txn=txn)
|
||||||
self.d.txn_proc(proc, txn)
|
self.d.txn_proc(proc, txn)
|
||||||
|
|
||||||
db = None
|
db = None
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ class SourceDB(object):
|
|||||||
|
|
||||||
self.d.txn_proc(proc, txn)
|
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
|
sourcedb = None
|
||||||
|
|
||||||
def init():
|
def init():
|
||||||
|
|||||||
Reference in New Issue
Block a user