diff options
-rw-r--r-- | python/rpmmodule.c | 14 |
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", ¯o)) + 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 }, |