* 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:
|
if not repo:
|
||||||
return haskey
|
return haskey
|
||||||
else:
|
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):
|
def get_item_repo(self, name, repo = None, txn = None):
|
||||||
name = str(name)
|
name = str(name)
|
||||||
|
|||||||
+2
-2
@@ -493,8 +493,8 @@ def plan_remove(A):
|
|||||||
while len(B) > 0:
|
while len(B) > 0:
|
||||||
Bp = set()
|
Bp = set()
|
||||||
for x in B:
|
for x in B:
|
||||||
pkg = ctx.packagedb.get_package(x)
|
pkg = ctx.packagedb.get_package(x, pisi.itembyrepodb.installed)
|
||||||
rev_deps = ctx.packagedb.get_rev_deps(x)
|
rev_deps = ctx.packagedb.get_rev_deps(x, pisi.itembyrepodb.installed)
|
||||||
for (rev_dep, depinfo) in rev_deps:
|
for (rev_dep, depinfo) in rev_deps:
|
||||||
# we don't deal with uninstalled rev deps
|
# we don't deal with uninstalled rev deps
|
||||||
# and unsatisfied dependencies (this is important, too)
|
# and unsatisfied dependencies (this is important, too)
|
||||||
|
|||||||
+3
-3
@@ -73,9 +73,9 @@ class PackageDB(object):
|
|||||||
def which_repo(self, name, txn = None):
|
def which_repo(self, name, txn = None):
|
||||||
return self.d.which_repo(name, txn=txn)
|
return self.d.which_repo(name, txn=txn)
|
||||||
|
|
||||||
def get_rev_deps(self, name):
|
def get_rev_deps(self, name, repo = None, txn = None):
|
||||||
if self.dr.has_key(name):
|
if self.dr.has_key(name, repo, txn=txn):
|
||||||
return self.dr.get_item(name)
|
return self.dr.get_item(name, repo, txn=txn)
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user