[Yum-devel] [PATCH] Filter "available updates" based on package name, for doUpdate, speedup ~25%.

Tim Lauridsen tim.lauridsen at gmail.com
Thu Sep 16 12:55:07 UTC 2010


On Wed, Sep 15, 2010 at 11:26 PM, James Antill <james at and.org> wrote:

> ---
>  rpmUtils/updates.py |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/rpmUtils/updates.py b/rpmUtils/updates.py
> index c61788b..3c4bbb4 100644
> --- a/rpmUtils/updates.py
> +++ b/rpmUtils/updates.py
> @@ -56,7 +56,8 @@ class Updates:
>
>         # make some dicts from installed and available
>         self.installdict = self.makeNADict(self.installed, 1)
> -        self.availdict = self.makeNADict(self.available, 0) # Done in
> doUpdate
> +        self.availdict = self.makeNADict(self.available, 0, # Done in
> doUpdate
> +                                         filter=self.installdict)
>
>         # holder for our updates dict
>         self.updatesdict = {}
> @@ -104,13 +105,15 @@ class Updates:
>         if self.debug:
>             print msg
>
> -    def makeNADict(self, pkglist, Nonelists):
> +    def makeNADict(self, pkglist, Nonelists, filter=None):
>         """return lists of (e,v,r) tuples as value of a dict keyed on (n,
> a)
>             optionally will return a (n, None) entry with all the a for
> that
>             n in tuples of (a,e,v,r)"""
>
>         returndict = {}
>         for (n, a, e, v, r) in pkglist:
> +            if filter and (n, None) not in filter:
> +                continue
>             if (n, a) not in returndict:
>                 returndict[(n, a)] = []
>             if (e,v,r) in returndict[(n, a)]:
> --
> 1.7.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/20100916/39b237e0/attachment.html>


More information about the Yum-devel mailing list