[Rpm-maint] [PATCH 2/2] Add a python accessor for the source header

Eric W. Biederman ebiederm at xmission.com
Sun Oct 10 14:36:34 UTC 2010


Make the source header visible to python code.

---
 python/spec-py.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/python/spec-py.c b/python/spec-py.c
index 3bba35e..a829539 100644
--- a/python/spec-py.c
+++ b/python/spec-py.c
@@ -184,6 +184,11 @@ static PyObject * spec_get_packages(specObject *s, void *closure)
     return pkgList;
 }
 
+static PyObject * spec_get_source_header(specObject *s, void *closure)
+{
+    return makeHeader(rpmSpecSourceHeader(s->spec));
+}
+
 static char spec_doc[] = "RPM Spec file object";
 
 static PyGetSetDef spec_getseters[] = {
@@ -193,6 +198,7 @@ static PyGetSetDef spec_getseters[] = {
     {"install",   (getter) spec_get_install, NULL, NULL },
     {"clean",   (getter) spec_get_clean, NULL, NULL },
     {"packages", (getter) spec_get_packages, NULL, NULL },
+    {"sourceHeader", (getter) spec_get_source_header, NULL, NULL },
     {NULL}  /* Sentinel */
 };
 
-- 
1.7.3.1



More information about the Rpm-maint mailing list