diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-11-27 09:28:11 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-11-27 09:28:11 +0200 |
commit | 8440195af4f1d578fa3c631df8ff186c6168e368 (patch) | |
tree | 0e3dc52f831547299f4e4d7f53ae40d2e73204fa /python/header-py.c | |
parent | 8ba98b21789e6e3525cf2fd47a3a473aa17a0f9d (diff) | |
download | rpm-8440195af4f1d578fa3c631df8ff186c6168e368.tar.gz rpm-8440195af4f1d578fa3c631df8ff186c6168e368.tar.bz2 rpm-8440195af4f1d578fa3c631df8ff186c6168e368.zip |
Correctly pass optional tag argument from hdr.dsFromHeader() (ticket #108)
Diffstat (limited to 'python/header-py.c')
-rw-r--r-- | python/header-py.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/python/header-py.c b/python/header-py.c index a878726c3..9ec44a91c 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -296,11 +296,18 @@ static PyObject * hdr_fiFromHeader(PyObject * s, PyObject * args, PyObject * kwd Py_BuildValue("(O)", s), NULL); } +/* Backwards compatibility. Flags argument is just a dummy and discarded. */ static PyObject * hdr_dsFromHeader(PyObject * s, PyObject * args, PyObject * kwds) { - /* XXX this isn't quite right wrt arg passing */ + rpmTag tag = RPMTAG_REQUIRENAME; + rpmsenseFlags flags = 0; + char * kwlist[] = {"to", "flags", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O&i:dsFromHeader", kwlist, + tagNumFromPyObject, &tag, &flags)) + return NULL; + return PyObject_Call((PyObject *) &rpmds_Type, - Py_BuildValue("(O)", s), kwds); + Py_BuildValue("(Oi)", s, tag), NULL); } static PyObject * hdr_dsOfHeader(PyObject * s) |