From 4c155d9ca8db9e5672e1f278ef76b68dd828f863 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sun, 10 Oct 2010 07:36:34 -0700 Subject: [PATCH] Add a python accessor for the source header Make the source header visible to python code. --- python/spec-py.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 */ }; -- 2.7.4