[Yum-devel] [PATCH] Try comparing provides versions, if they all match. BZ 782345.

Ales Kozumplik akozumpl at redhat.com
Wed Jan 18 08:02:50 UTC 2012


Hi James,

just a couple of notes.

>   yum/__init__.py |   26 +++++++++++++++-----------
>   yum/depsolve.py |   40 +++++++++++++++++++++++++++++++++++++++-
>   2 files changed, 54 insertions(+), 12 deletions(-)
>
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 994a840..02f25ae 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -3461,7 +3461,8 @@ class YumBase(depsolve.Depsolve):
>               raise Errors.YumBaseError, _('No Package found for %s') % errstring
>
>           ps = ListPackageSack(pkglist)
> -        result = self._bestPackageFromList(ps.returnNewestByNameArch())
> +        result = self._bestPackageFromList(ps.returnNewestByNameArch(),
> +                                           req=errstring)

errstring is an unfortunate name for something a string describing the 
sought dependency.


> +    def bestPackagesFromList(self, pkglist, arch=None, single_name=False,
> +                             req=None):
>           """Return the best packages from a list of packages.  This
>           function is multilib aware, so that it will not compare
>           multilib to singlelib packages.

The comments are missing description for the new req parameter.


>
> -    def _compare_providers(self, pkgs, reqpo):
> +    def _compare_providers(self, pkgs, reqpo, req=None):
>           """take the list of pkgs and score them based on the requesting package
>              return a dictionary of po=score"""
>           self.verbose_logger.log(logginglevels.DEBUG_4,
>                 _("Running compare_providers() for %s") %(str(pkgs)))
> +        print "JDBG:", pkgs, reqpo, req

debugging leftover.

The rest looks on par with the rest of yum.

Ales


More information about the Yum-devel mailing list