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

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


Hello,

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
data.
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
http://ftp.redhat.com/pub/redhat/linux/enterprise/6Workstation/en/os/SRPMS/rpm-4.8.0-16.el6.src.rpm

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: <http://lists.rpm.org/pipermail/rpm-list/attachments/20110911/cc229a64/attachment.html>


More information about the Rpm-list mailing list