[Yum-devel] [PATCH 2/3] Do the pkgmatch_fails negative caching, in _search

Seth Vidal skvidal at fedoraproject.org
Mon Apr 12 17:07:01 UTC 2010



On Mon, 12 Apr 2010, James Antill wrote:

> ---
> yum/rpmsack.py |   10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/yum/rpmsack.py b/yum/rpmsack.py
> index 179b008..2b932cf 100644
> --- a/yum/rpmsack.py
> +++ b/yum/rpmsack.py
> @@ -986,6 +986,9 @@ class RPMDBPackageSack(PackageSackBase):
>
>     def _search(self, name=None, epoch=None, ver=None, rel=None, arch=None):
>         '''List of matching packages, to zero or more of NEVRA.'''
> +        if name is not None and name in self._pkgmatch_fails:
> +            return []
> +

anything wrong with:

if name and name in self._pkgmatch_fails:

the 'is not None' thing I've tried to stop using b/c it gets in weird 
trouble with funky object types.

> +        if not done and name is not None:

same here.


otherwise, ack.
-sv



More information about the Yum-devel mailing list