[Yum-devel] [PATCH] bump the score of a provider in compare_provider if the reqpo pkg and it have the same repository.
Seth Vidal
skvidal at fedoraproject.org
Fri Oct 16 14:50:14 UTC 2009
---
yum/depsolve.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 40be000..b10a72c 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -1167,7 +1167,11 @@ class Depsolve(object):
_('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
pkgresults[po] += cpl*2
-
+
+ # if a provider is from the same repo as the reqpo
+ # give it a slight nudge
+ if reqpo.repoid == po.repoid:
+ pkgresults[po] += 2
pkgresults[po] += (len(po.name)*-1)
bestorder = sorted(pkgresults.items(), cmp=_cmp_best_providers)
--
1.6.2.5
More information about the Yum-devel
mailing list