[Yum-devel] [PATCH 2/3] Always sort installed repos. after available repos.

tim.lauridsen at gmail.com tim.lauridsen at gmail.com
Tue Jun 14 10:35:16 UTC 2011


On Mon, Jun 13, 2011 at 9:55 PM, James Antill <james at and.org> wrote:

> ---
>  yum/packages.py |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/yum/packages.py b/yum/packages.py
> index 0d16293..d8043f9 100644
> --- a/yum/packages.py
> +++ b/yum/packages.py
> @@ -299,6 +299,11 @@ class PackageObject(object):
>             ret = cmp(self.arch, other.arch)
>         if ret == 0 and hasattr(self, 'repoid') and hasattr(other,
> 'repoid'):
>             ret = cmp(self.repoid, other.repoid)
> +            # We want 'installed' to appear over 'abcd' and 'xyz', so
> boost that
> +            if ret and self.repoid == 'installed':
> +                return 1
> +            if ret and other.repoid == 'installed':
> +                return -1
>         return ret
>     def __eq__(self, other):
>         """ Compare packages for yes/no equality, includes everything in
> the
> --
> 1.7.5.2
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel


ACK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20110614/657d86d9/attachment.html>


More information about the Yum-devel mailing list