* make the search for rev. deps more readable by flipping an if else

This commit is contained in:
Eray Özkural
2006-05-07 01:33:49 +00:00
parent f84ebc1b49
commit d580554ad1
+5 -6
View File
@@ -454,19 +454,18 @@ def plan_upgrade(A, ignore_build = False):
for dep in pkg.runtimeDependencies(): for dep in pkg.runtimeDependencies():
# add packages that can be upgraded # add packages that can be upgraded
if dependency.repo_satisfies_dep(dep): if dependency.repo_satisfies_dep(dep):
#TODO: distinguish must upgrade and upgradable
if ctx.installdb.is_installed(dep.package): if ctx.installdb.is_installed(dep.package):
if not ctx.get_option('eager'): if ctx.get_option('eager'):
if dependency.installed_satisfies_dep(dep): if not upgradable(dep):
continue continue
else: else:
if not upgradable(dep): if dependency.installed_satisfies_dep(dep):
continue continue
if not dep.package in G_f.vertices(): if not dep.package in G_f.vertices():
Bp.add(str(dep.package)) Bp.add(str(dep.package))
G_f.add_dep(x, dep) G_f.add_dep(x, dep)
else: else:
raise Error(_("Reverse dependency %s cannot be satisfied") % rev_dep) raise Error(_('Dependency %s cannot be satisfied') % rev_dep)
B = Bp B = Bp
# now, search reverse dependencies to see if anything # now, search reverse dependencies to see if anything
# should be upgraded # should be upgraded
@@ -482,7 +481,7 @@ def plan_upgrade(A, ignore_build = False):
if packagedb.has_package(rev_dep) and \ if packagedb.has_package(rev_dep) and \
(not dependency.installed_satisfies_dep(depinfo)): (not dependency.installed_satisfies_dep(depinfo)):
if not dependency.repo_satisfies_dep(depinfo): if not dependency.repo_satisfies_dep(depinfo):
raise Error(_("Reverse dependency %s cannot be satisfied") % rev_dep) raise Error(_('Reverse dependency %s cannot be satisfied') % rev_dep)
if not rev_dep in G_f.vertices(): if not rev_dep in G_f.vertices():
Bp.add(rev_dep) Bp.add(rev_dep)
G_f.add_plain_dep(rev_dep, x) G_f.add_plain_dep(rev_dep, x)