upgrade: Fix the logic when finding broken packages

Usually the reverse dependency gets broken *after* the upgrade is done. So,
we must check the dependency info with satisfied_by_repo instead of
satisfied_by_installed.

This commit will hopefully fix the upgrade operations failing with:
"Reverse dependency X of Y cannot be satisfied"
This commit is contained in:
Fatih Aşıcı
2010-04-27 17:29:55 +00:00
parent d6849c5b88
commit 3c223f21b7
+4 -8
View File
@@ -271,16 +271,12 @@ def plan_upgrade(A, force_replaced=True, replaces=None):
rev_deps = installdb.get_rev_deps(pkg.name)
for rev_dep, depinfo in rev_deps:
# add only installed but unsatisfied reverse dependencies
if rev_dep in G_f.vertices() or \
depinfo.satisfied_by_installed() or \
not is_upgradable(rev_dep):
if rev_dep in G_f.vertices() or depinfo.satisfied_by_repo():
continue
if not depinfo.satisfied_by_repo():
raise Exception(_('Reverse dependency %s of %s cannot be satisfied') % (rev_dep, pkg.name))
Bp.add(rev_dep)
G_f.add_plain_dep(rev_dep, pkg.name)
if is_upgradable(rev_dep):
Bp.add(rev_dep)
G_f.add_plain_dep(rev_dep, pkg.name)
def add_needed_revdeps(pkg, Bp):
# Search for reverse dependency update needs of to be upgraded packages