Bug 462726 - python binding for spec object is missing access to the packages & headers
python binding for spec object is missing access to the packages & headers
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
: FutureFeature, Patch
Depends On:
  Show dependency treegraph
Reported: 2008-09-18 11:40 EDT by Daniel Berrange
Modified: 2009-11-19 06:06 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-11-19 06:06:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Add binding to the package object in a spec (16.17 KB, patch)
2008-09-18 11:41 EDT, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Daniel Berrange 2008-09-18 11:40:14 EDT
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):

How reproducible:

Steps to Reproduce:

cat > foo.py <<EOF
import rpm

ts = rpm.ts()
spec = ts.parseSpec("gtk2.spec")
print str(spec.packages())

2. python foo.py
Actual results:
Traceback (most recent call last):
  File "foo.py", line 4, in <module>
    print str(spec.packages())
AttributeError: 'rpm.spec' object has no attribute 'packages'

Expected results:
$ python foo.py 
(<rpm.pkg object at 0x7f127df6a0f0>, <rpm.pkg object at 0x7f127df6a108>, <rpm.pkg object at 0x7f127df6a120>)

Additional info:
Comment 1 Daniel Berrange 2008-09-18 11:41:08 EDT
Created attachment 317088 [details]
Add binding to the package object in a spec

Patch also sent upstream to:

Comment 2 Panu Matilainen 2009-11-19 06:06:39 EST
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.

Note You need to log in before you can comment on or make changes to this bug.