* fix: remove must look at installed db not the remote repository!
* fix: db code, make get_rev_deps and has_key work with repo args...
This commit is contained in:
@@ -113,7 +113,8 @@ class ItemByRepoDB(object):
|
||||
if not repo:
|
||||
return haskey
|
||||
else:
|
||||
return haskey and self.d.get(name, txn).has_key(repo)
|
||||
repostr = self.repo_str(repo)
|
||||
return haskey and self.d.get(name, txn).has_key(repostr)
|
||||
|
||||
def get_item_repo(self, name, repo = None, txn = None):
|
||||
name = str(name)
|
||||
|
||||
+2
-2
@@ -493,8 +493,8 @@ def plan_remove(A):
|
||||
while len(B) > 0:
|
||||
Bp = set()
|
||||
for x in B:
|
||||
pkg = ctx.packagedb.get_package(x)
|
||||
rev_deps = ctx.packagedb.get_rev_deps(x)
|
||||
pkg = ctx.packagedb.get_package(x, pisi.itembyrepodb.installed)
|
||||
rev_deps = ctx.packagedb.get_rev_deps(x, pisi.itembyrepodb.installed)
|
||||
for (rev_dep, depinfo) in rev_deps:
|
||||
# we don't deal with uninstalled rev deps
|
||||
# and unsatisfied dependencies (this is important, too)
|
||||
|
||||
+3
-3
@@ -73,9 +73,9 @@ class PackageDB(object):
|
||||
def which_repo(self, name, txn = None):
|
||||
return self.d.which_repo(name, txn=txn)
|
||||
|
||||
def get_rev_deps(self, name):
|
||||
if self.dr.has_key(name):
|
||||
return self.dr.get_item(name)
|
||||
def get_rev_deps(self, name, repo = None, txn = None):
|
||||
if self.dr.has_key(name, repo, txn=txn):
|
||||
return self.dr.get_item(name, repo, txn=txn)
|
||||
else:
|
||||
return []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user