diff --git a/pisi/itembyrepodb.py b/pisi/itembyrepodb.py index dca5fd37..60a349d1 100644 --- a/pisi/itembyrepodb.py +++ b/pisi/itembyrepodb.py @@ -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(): diff --git a/pisi/packagedb.py b/pisi/packagedb.py index a77e0332..d59add67 100644 --- a/pisi/packagedb.py +++ b/pisi/packagedb.py @@ -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)