Red Hat Bugzilla – Bug 462726
python binding for spec object is missing access to the packages & headers
Last modified: 2009-11-19 06:06:39 EST
Description of problem:
I'm trying todo some automated processing & analysis of RPM specfiles
and have found the python binding is lacking a number of key features
- The 'spec' object allows access to the lists of sources, but doesn't
expose the RPMBUILD_ISXXXX constants
- The 'spec' object does not provide access to the 'packages' objects
so you can't query most metadata about the spec.
- None of the RPMTAG_XXX constants are defined, which makes using the
'header' object unpleasant.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
cat > foo.py <<EOF
ts = rpm.ts()
spec = ts.parseSpec("gtk2.spec")
2. python foo.py
Traceback (most recent call last):
File "foo.py", line 4, in <module>
AttributeError: 'rpm.spec' object has no attribute 'packages'
$ python foo.py
(<rpm.pkg object at 0x7f127df6a0f0>, <rpm.pkg object at 0x7f127df6a108>, <rpm.pkg object at 0x7f127df6a120>)
Created attachment 317088 [details]
Add binding to the package object in a spec
Patch also sent upstream to:
This is implemented upstream finally. Implemented somewhat differently due to various other changes that have happened in the meanwhile, but the functionality is there.
Thanks for your patience and the patch too.