* goddamn remove_item, make it work this time
This commit is contained in:
+10
-5
@@ -123,8 +123,8 @@ class ItemByRepoDB(object):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def which_repo(self, name, repo = None, txn = None):
|
def which_repo(self, name, txn = None):
|
||||||
x = self.get_item_repo(name, repo, txn)
|
x = self.get_item_repo(name, txn=txn)
|
||||||
if x:
|
if x:
|
||||||
item, repo = x
|
item, repo = x
|
||||||
return repo
|
return repo
|
||||||
@@ -155,13 +155,18 @@ class ItemByRepoDB(object):
|
|||||||
self.d.put(name, s, txn)
|
self.d.put(name, s, txn)
|
||||||
self.d.txn_proc(p, 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):
|
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.remove_item_repo(name, repo, txn=txn)
|
||||||
self.d.txn_proc(p, 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 remove_repo(self, repo, txn = None):
|
||||||
def proc(txn):
|
def proc(txn):
|
||||||
for key in self.d.keys():
|
for key in self.d.keys():
|
||||||
|
|||||||
+3
-3
@@ -115,9 +115,9 @@ class PackageDB(object):
|
|||||||
def remove_package(self, name, repo = None, txn = None):
|
def remove_package(self, name, repo = None, txn = None):
|
||||||
name = str(name)
|
name = str(name)
|
||||||
def proc(txn):
|
def proc(txn):
|
||||||
package_info = self.d.get_item(name, repo, txn)
|
package_info = self.d.get_item(name, repo, txn=txn)
|
||||||
self.d.remove_item(name, repo, txn)
|
self.d.remove_item(name, repo, txn=txn)
|
||||||
self.dr.remove_item(name, repo, txn)
|
self.dr.remove_item(name, repo, txn=txn)
|
||||||
#WORKAROUND: do not remove component if it is not in repo
|
#WORKAROUND: do not remove component if it is not in repo
|
||||||
if type(repo)==types.StringType:
|
if type(repo)==types.StringType:
|
||||||
ctx.componentdb.remove_package(package_info.partOf, package_info.name, txn)
|
ctx.componentdb.remove_package(package_info.partOf, package_info.name, txn)
|
||||||
|
|||||||
Reference in New Issue
Block a user