summaryrefslogtreecommitdiff
path: root/python/rpmmodule.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-08-28 12:03:34 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-08-28 12:03:34 +0300
commit5b4a0061a664ce40d5ab9cfbab906d3ce160c21c (patch)
tree288f7e34b26b24e633a3ccf6955e13923beb7785 /python/rpmmodule.c
parent721b8777c158856110320919d1cf6180dadee1eb (diff)
downloadlibrpm-tizen-5b4a0061a664ce40d5ab9cfbab906d3ce160c21c.tar.gz
librpm-tizen-5b4a0061a664ce40d5ab9cfbab906d3ce160c21c.tar.bz2
librpm-tizen-5b4a0061a664ce40d5ab9cfbab906d3ce160c21c.zip
Add expandMacro() to python bindings.
Patch by Jeremy Katz.
Diffstat (limited to 'python/rpmmodule.c')
-rw-r--r--python/rpmmodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
index 812521cf3..2a0ee11d1 100644
--- a/python/rpmmodule.c
+++ b/python/rpmmodule.c
@@ -44,6 +44,18 @@ PyObject * pyrpmError;
/**
*/
+static PyObject * expandMacro(PyObject * self, PyObject * args, PyObject * kwds)
+{
+ char * macro;
+
+ if (!PyArg_ParseTuple(args, "s", &macro))
+ return NULL;
+
+ return Py_BuildValue("s", rpmExpand(macro, NULL));
+}
+
+/**
+ */
static PyObject * archScore(PyObject * self, PyObject * args, PyObject * kwds)
{
char * arch;
@@ -187,6 +199,8 @@ static PyMethodDef rpmModuleMethods[] = {
NULL },
{ "delMacro", (PyCFunction) rpmrc_DelMacro, METH_VARARGS|METH_KEYWORDS,
NULL },
+ { "expandMacro", (PyCFunction) expandMacro, METH_VARARGS|METH_KEYWORDS,
+ NULL },
{ "archscore", (PyCFunction) archScore, METH_VARARGS|METH_KEYWORDS,
NULL },