[Yum-devel] [PATCH] bump the score of a provider in compare_provider if the reqpo pkg and it have the same repository.

James Antill james at fedoraproject.org
Fri Oct 16 15:32:38 UTC 2009


On Fri, 2009-10-16 at 10:50 -0400, Seth Vidal wrote:
> ---
>  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

 This needs to be "if repqpo and reqpo.repoid == po.repoid"

>              pkgresults[po] += (len(po.name)*-1)
>  
>          bestorder = sorted(pkgresults.items(), cmp=_cmp_best_providers)


More information about the Yum-devel mailing list