Help with python api, accessing missing "requires" fields from a .src.rpm

Thomas Dziedzic gostrc at
Mon Sep 12 03:03:27 UTC 2011


I'm trying to use the rpm python api and I have a question about retrieving
info from hdrFromFdno
I do hdr = hdrFromFdno(fd), and then I get back a hdr object with lots of
The problem is that it seems that hdr lacks the Requires: parts of the .spec
file. Everything else seems to be there, including the BuildRequires.
The fd is for "rpm-4.8.0-16.el6.src.rpm" which I got from

hdr[rpm.RPMTAG_REQUIRES] seems to be the BuildRequires portion of the .spec

when I search for coreutils (one of the Requires packages) in the hdr by
doing: for k in hdr: if isinstance(hdr[k], collections.Iterable): if
'coreutils' in hdr[k]: print k I get nothing

Thanks for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Rpm-list mailing list