Bug 462726 - python binding for spec object is missing access to the packages & headers
Summary: python binding for spec object is missing access to the packages & headers
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-09-18 15:40 UTC by Daniel Berrangé
Modified: 2009-11-19 11:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-11-19 11:06:39 UTC
Type: ---
Embargoed:


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

Description Daniel Berrangé 2008-09-18 15:40:14 UTC
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):
rpm-4.5.90-0.git8461.7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. 

cat > foo.py <<EOF
import rpm

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

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 Berrangé 2008-09-18 15:41:08 UTC
Created attachment 317088 [details]
Add binding to the package object in a spec

Patch also sent upstream to:

https://lists.dulug.duke.edu/pipermail/rpm-maint/2008-September/001132.html

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