]> git.ipfire.org Git - pakfire.git/blob - src/util.c
Unify util.py.
[pakfire.git] / src / util.c
1
2 #include <Python.h>
3
4 #include "util.h"
5
6 PyObject *version_compare(PyObject *self, PyObject *args) {
7 Pool *pool;
8 const char *evr1, *evr2;
9
10 if (!PyArg_ParseTuple(args, "Oss", &pool, &evr1, &evr2)) {
11 /* XXX raise exception */
12 return NULL;
13 }
14
15 int ret = pool_evrcmp_str(pool, evr1, evr2, EVRCMP_COMPARE);
16
17 return Py_BuildValue("i", ret);
18 }