[Yum-devel] [PATCH] Make a specical codepath for /path/to/* searches

Seth Vidal skvidal at fedoraproject.org
Mon Sep 28 17:43:48 UTC 2009



On Mon, 28 Sep 2009, James Antill wrote:

> ---
> yum/sqlitesack.py |   14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
> index 9bfcd93..ce2988f 100644
> --- a/yum/sqlitesack.py
> +++ b/yum/sqlitesack.py
> @@ -911,6 +911,20 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
>             dirname_check = "dirname GLOB ? and filenames LIKE ? %s and " % esc
>             sql_params.append(dirname)
>             sql_params.append('%' + pattern + '%')
> +        elif filename == '*':
> +            # We only care about matching on dirname...
> +            for (rep,cache) in self.filelistsdb.items():
> +                if rep in self._all_excludes:
> +                    continue
> +
> +                cur = cache.cursor()
> +                sql_params.append(dirname)
> +                executeSQL(cur, """SELECT pkgKey FROM filelist
> +                                   WHERE dirname %s ?""" % (querytype,),
> +                           sql_params)
> +                self._sql_pkgKey2po(rep, cur, pkgs)
> +
> +            return misc.unique(pkgs)
>
>         for (rep,cache) in self.filelistsdb.items():
>             if rep in self._all_excludes:

The patch is fine - but what's the USE case for this? It's not like 
someone can dep on /path/to/*

-sv



More information about the Yum-devel mailing list