[Yum-devel] [PATCH] Fix SQLite names-only simplePkgList.

James Antill james at fedoraproject.org
Fri Oct 23 17:43:56 UTC 2009


On Fri, 2009-10-23 at 19:08 +0300, Ville Skyttä wrote:
> On Friday 23 October 2009, James Antill wrote:
> > On Fri, 2009-10-23 at 16:57 +0300, Ville Skyttä wrote:
> > > ---
> > >  yum/sqlitesack.py |    3 +++
> > >  1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
> > > index 332f3bb..bb2d856 100644
> > > --- a/yum/sqlitesack.py
> > > +++ b/yum/sqlitesack.py
> > > @@ -1616,6 +1616,9 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
> > >          # Haven't loaded everything, so _just_ get the pkgtups...
> > >          data = self._setupPkgObjList(repoid, patterns, ignore_case)
> > >          (need_full, patterns, fields, names) = data
> > > +        if names:
> > > +            return self.searchNames(patterns)
> > > +
> > >          for (repo, x) in self._yieldSQLDataList(repoid, patterns,
> > > fields, ignore_case):
> > >              # NOTE: Can't unexclude things...
> > 
> >  This can't work as simplePkgList() returns a list of pkgtup, not a list
> > of package objects. Now, in theory, you could do:
> > 
> > 
> > +        if names:
> > +            return [pkg.pkgtup for pkg in self.searchNames(patterns)]
> > +
> 
> Ok, curiously both of the above approaches work for my test case, see below.

[...]

>   File "/home/scop/cvs/yum/yum/sqlitesack.py", line 1620, in simplePkgList
>     ignore_case):
>   File "/home/scop/cvs/yum/yum/sqlitesack.py", line 1527, in _yieldSQLDataList
>     for (pattern, rest) in patterns:
> ValueError: too many values to unpack

 Bugger, patterns is returned for searchNames() when names is True. ACK
list comp. above.



More information about the Yum-devel mailing list