[Rpm-maint] PATCH: Accessing file and policy lists from python (and C)
pmatilai at laiskiainen.org
Fri Sep 21 05:02:53 UTC 2012
On 09/15/2012 05:47 PM, Alec Leamas wrote:
> When rpm-build parses the specfile, it also parses the file list and
> (nowadays?) also the policy. These are stored in specPackage objects
> attached to the spec. However, these items are not visible on the
> rpm.specPkg interface, neither from C nor from python.
> Is there a particular reason these items aren't visible?
It's simply because access to the flat, unpopulated file list doesn't
seem useful at all to me, and not exposing something means not having to
commit to an interface for it.
> I have som pronlems with this related to the fedora-review tool ,
> which basically forces us to use some hand-crafted specfile parsing ,
> since the file lists are needed. I would certainly prefer using rpmlib's
> own parsing for that. However, then external access to the fields
> fileList, fileFile and policyList is needed. The enclosed patch arranges
I'm curious: what exactly are you doing / planning to do with the file list?
> Would it be possible to solve the access to the mentioned list, perhaps
> by accepting the patch?
That's one possible approach, but returning them as ARGV_t exposes an
internal implementation detail that's more likely to change than not. If
it truly needs to be exported, I'd rather export it in the flat text
format as it is. One possibility is through rpmspecGetSection() which
could convert the internal presentation to a plain string for handing
out (and the caller gets to do split by \n)
- Panu -
More information about the Rpm-maint