* goddamn remove_item, make it work this time

This commit is contained in:
Eray Özkural
2006-03-24 15:36:16 +00:00
parent 6f5f41aca9
commit 6eff14900e
2 changed files with 13 additions and 8 deletions
+10 -5
View File
@@ -123,8 +123,8 @@ class ItemByRepoDB(object):
else:
return None
def which_repo(self, name, repo = None, txn = None):
x = self.get_item_repo(name, repo, txn)
def which_repo(self, name, txn = None):
x = self.get_item_repo(name, txn=txn)
if x:
item, repo = x
return repo
@@ -155,13 +155,18 @@ class ItemByRepoDB(object):
self.d.put(name, s, txn)
self.d.txn_proc(p, txn)
def remove_item(self, name, repo = None, txn = None):
def remove_item_only(self, name, txn = None):
def p(txn):
if repo == None:
repo = self.which_repo(name, txn=txn)
repo = self.which_repo(name, txn=txn)
self.remove_item_repo(name, repo, txn=txn)
self.d.txn_proc(p, txn)
def remove_item(self, name, repo=None, txn=None):
if repo:
self.remove_item_repo(name,repo,txn=txn)
else:
self.remove_item_only(name,txn=txn)
def remove_repo(self, repo, txn = None):
def proc(txn):
for key in self.d.keys():
+3 -3
View File
@@ -115,9 +115,9 @@ class PackageDB(object):
def remove_package(self, name, repo = None, txn = None):
name = str(name)
def proc(txn):
package_info = self.d.get_item(name, repo, txn)
self.d.remove_item(name, repo, txn)
self.dr.remove_item(name, repo, txn)
package_info = self.d.get_item(name, repo, txn=txn)
self.d.remove_item(name, repo, txn=txn)
self.dr.remove_item(name, repo, txn=txn)
#WORKAROUND: do not remove component if it is not in repo
if type(repo)==types.StringType:
ctx.componentdb.remove_package(package_info.partOf, package_info.name, txn)