From 1bfa40a18b46d6674b09b77e7d4fabb2e23a6e15 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 22 Jan 2008 08:09:28 +0000 Subject: [PATCH] Pass arch to compare function in solver. For source code, arch isn't constant. --- zeroinstall/injector/solver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zeroinstall/injector/solver.py b/zeroinstall/injector/solver.py index e9e486f..dbea603 100644 --- a/zeroinstall/injector/solver.py +++ b/zeroinstall/injector/solver.py @@ -127,14 +127,14 @@ class DefaultSolver(Solver): if self.record_details: # In details mode, rank all the implementations and then choose the best - impls.sort(lambda a, b: compare(iface, a, b)) + impls.sort(lambda a, b: compare(iface, a, b, arch)) best = impls[0] self.details[iface] = [(impl, get_unusable_reason(impl, restrictions.get(iface, []), arch)) for impl in impls] else: # Otherwise, just choose the best without sorting best = impls[0] for x in impls[1:]: - if compare(iface, x, best) < 0: + if compare(iface, x, best, arch) < 0: best = x unusable = get_unusable_reason(best, restrictions.get(iface, []), arch) if unusable: @@ -142,7 +142,7 @@ class DefaultSolver(Solver): return None return best - def compare(interface, b, a): + def compare(interface, b, a, arch): """Compare a and b to see which would be chosen first. @param interface: The interface we are trying to resolve, which may not be the interface of a or b if they are from feeds. -- 2.11.4.GIT