[Yum-devel] [PATCH] Don't load all of the rpmdb in matchPackageNames(), used by at least rm.

Seth Vidal skvidal at fedoraproject.org
Thu Feb 18 19:04:23 UTC 2010



On Thu, 18 Feb 2010, James Antill wrote:

> ---
> yum/packageSack.py |    8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/yum/packageSack.py b/yum/packageSack.py
> index 6e986a4..0d9301b 100644
> --- a/yum/packageSack.py
> +++ b/yum/packageSack.py
> @@ -255,7 +255,6 @@ class PackageSackBase(object):
>     def searchAll(self, arg, query_type):
>         raise NotImplementedError()
>
> -    # FIXME: This needs to be merged with how "yum list" works.
>     def matchPackageNames(self, pkgspecs):
>         """take a list strings and match the packages in the sack against it
>            this will match against:
> @@ -281,8 +280,11 @@ class PackageSackBase(object):
>                 specs[p] = re.compile(restring)
>             else:
>                 specs[p] = p
> -
> -        for pkgtup in self.simplePkgList():
> +
> +        #  We don't use simplePkgList() here because that loads all of the
> +        # rpmdb, if we are Eg. doing a "remove PackageKit".
> +        pkgs = self.returnPackages(patterns=unmatched)
> +        for pkgtup in [pkg.pkgtup for pkg in pkgs]:
>             (n,a,e,v,r) = pkgtup
>             names = set((
>                 n,


Ack

-sv



More information about the Yum-devel mailing list