[Yum-devel] Re: [Yum] Scripting Yum

seth vidal skvidal at phy.duke.edu
Fri Aug 5 08:39:48 UTC 2005


On Fri, 2005-08-05 at 01:28 -0700, Panu Matilainen wrote:
> ..moving to yum-devel...
> 
> On Fri, 5 Aug 2005, seth vidal wrote:
> > On Fri, 2005-08-05 at 00:51 -0700, Panu Matilainen wrote:
> >> Some of what you might already exist in repoquery from yum-utils, which
> >> unlike yum, is intented for scripting, just as rpm -q is and has rpm-like
> >> --queryformat formatting support. The current version wont give you
> >> 'updated packages' in any easy way (you'd have to compare against rpm -q
> >> output etc) but I'm not opposed to adding something like
> >> --list=updates/avail/recent/extras to it as that functionality already
> >> exists in yum libraries.
> >>
> >
> > honestly I need to take most of the code from cli.py and put a
> > simplified update method in yum/__init__.py
> >
> > then you could get 'updated packages' a lot more simply.
> 
> Mm, yum.doPackageLists() is just fine, but if it returned a dict instead 
> of misc.GenericHolder() or the holder behaved like a dict it'd be nicer to 
> use for certain things, eg:
> 
> ypl = doPackageLists(pkgnarrow=opts.pkgnarrow)
> for pkg in ypl[opts.pkgnarrow]:
>      ... do stuff ...
> 
> instead of the current situation where you'll need to either have lots of 
> if's or do something like
> 
> ypl = doPackageLists(pkgnarrow=opts.pkgnarrow)
> for pkg in getattr(ypl, opts.pkgnarrow):
>      ... do stuff ...
> 
> Any objections to such a change?

but I kinda like how pretty 
ygh.updates  looks, though :)

how about just plugging a dict onto the ygh that returns those items

ygh.dict['updates'] = ygh.updates

hmm

I'm not really sure which is hackier, here. :)

-sv







More information about the Yum-devel mailing list