summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 },