[Yum-devel] YumInstalledPackage

Paul Nasrat pnasrat at redhat.com
Tue Jan 31 01:32:26 UTC 2006


On Mon, 2006-01-30 at 19:58 -0500, Jack Neely wrote:
> Seth,
> 
> Trying to use the PO interface rather than hack at rpm headers everytime
> I need something.  However YumInstalledPackage doesn't have the prco
> dict populated which is painful.

It'd be helpful to have a code snippet to replicate:


import yum
y = yum.YumBase()
y.doGenericSetup(cache=1)
pl = y.doPackageLists(pkgnarrow='all')
pl.installed[3].returnPrco('provides')

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/repomd/packageObject.py", line
224, in returnPrco
    if self.prco.has_key(prcotype):
AttributeError: YumInstalledPackage instance has no attribute 'prco'


> This is really a bug but I don't see really any easy way to fix it as
> the code that generates the prco data/format is deep in createrepo.

This is unrelated to createrepo as YumInstalledPackage is a wrapper
around hdr from the rpmdb.  I'd agree this is a bug we probably want an
importFromHdr analagous to importFromDict from YumAvailablePackage that
populates things.

Paul




More information about the Yum-devel mailing list