[commit: Cabal] master: fix package ordering bug (52a3294)
Ian Lynagh
igloo at earth.li
Fri Nov 4 18:05:54 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/52a32946fb286d83b514e1999b6ade30f85ed688
>---------------------------------------------------------------
commit 52a32946fb286d83b514e1999b6ade30f85ed688
Author: Andres Loeh <andres at well-typed.com>
Date: Wed Jun 15 07:36:30 2011 +0000
fix package ordering bug
>---------------------------------------------------------------
.../Client/Dependency/Modular/Preference.hs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs b/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
index a03a189..6e46452 100644
--- a/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
+++ b/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs
@@ -51,8 +51,13 @@ preferPackagePreferences pcs = packageOrderFor (const True) preference
in preferredVersionsOrdering vr v1 v2 `mappend` -- combines lexically
locationsOrdering ipref i1 i2
- locationsOrdering PreferInstalled = preferInstalledOrdering
- locationsOrdering PreferLatest = preferLatestOrdering
+ -- Note that we always rank installed before uninstalled, and later
+ -- versions before earlier, but we can change the priority of the
+ -- two orderings.
+ locationsOrdering PreferInstalled v1 v2 =
+ preferInstalledOrdering v1 v2 `mappend` preferLatestOrdering v1 v2
+ locationsOrdering PreferLatest v1 v2 =
+ preferLatestOrdering v1 v2 `mappend` preferInstalledOrdering v1 v2
-- | Ordering that treats installed instances as greater than uninstalled ones.
preferInstalledOrdering :: I -> I -> Ordering
More information about the Cvs-libraries
mailing list