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

Panu Matilainen pmatilai at laiskiainen.org
Fri Aug 5 08:28:44 UTC 2005


..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?

 	- Panu -



More information about the Yum-devel mailing list