diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-28 16:25:46 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-28 16:25:46 +0200 |
commit | 46b2df7c577b3f22a167bc46e655c9c008133a66 (patch) | |
tree | 120a1f053fb44947d0d58f8e0e908f9a2085c973 /python/rpmds-py.c | |
parent | 1ce136261da3bd39ee10e31ed02d11a37da19126 (diff) | |
download | librpm-tizen-46b2df7c577b3f22a167bc46e655c9c008133a66.tar.gz librpm-tizen-46b2df7c577b3f22a167bc46e655c9c008133a66.tar.bz2 librpm-tizen-46b2df7c577b3f22a167bc46e655c9c008133a66.zip |
Add ds.Compare() as a thin wrapper over rpmdsCompare()
Diffstat (limited to 'python/rpmds-py.c')
-rw-r--r-- | python/rpmds-py.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c index e09498ec3..3c17869e1 100644 --- a/python/rpmds-py.c +++ b/python/rpmds-py.c @@ -277,6 +277,16 @@ rpmds_Search(rpmdsObject * s, PyObject * arg) return Py_BuildValue("i", rpmdsSearch(s->ds, o->ds)); } +static PyObject *rpmds_Compare(rpmdsObject * s, PyObject * o) +{ + rpmdsObject * ods; + + if (!PyArg_Parse(o, "O!:Compare", &rpmds_Type, &ods)) + return NULL; + + return PyBool_FromLong(rpmdsCompare(s->ds, ods->ds)); +} + static PyObject * rpmds_Rpmlib(rpmdsObject * s) { rpmds ds = NULL; @@ -325,6 +335,8 @@ static struct PyMethodDef rpmds_methods[] = { The current index in ds is positioned at overlapping member upon success.\n" }, {"Rpmlib", (PyCFunction)rpmds_Rpmlib, METH_NOARGS|METH_STATIC, "ds.Rpmlib -> nds - Return internal rpmlib dependency set.\n"}, + {"Compare", (PyCFunction)rpmds_Compare, METH_O, + NULL}, {NULL, NULL} /* sentinel */ }; |