From e452178719feb9da80a6b6c056d95d562af11823 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 2 Sep 2010 16:14:46 +0300 Subject: [PATCH] Permit passing spec parse flags in python too - The preferred flags default would be RPMSPEC_NONE, but it would break compatibility with older rpm versions where rpm.spec() doesn't accept flags. --- python/spec-py.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/spec-py.c b/python/spec-py.c index 63c3aa8..606c232 100644 --- a/python/spec-py.c +++ b/python/spec-py.c @@ -213,14 +213,14 @@ static PyGetSetDef spec_getseters[] = { static PyObject *spec_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) { - char * kwlist[] = {"specfile", NULL}; + char * kwlist[] = {"specfile", "flags", NULL}; const char * specfile; rpmSpec spec = NULL; - /* TODO: add arguments to control these */ + /* XXX This is a dumb default but anything else breaks compatibility... */ rpmSpecFlags flags = (RPMSPEC_ANYARCH|RPMSPEC_FORCE); - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s:spec_new", kwlist, - &specfile)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i:spec_new", kwlist, + &specfile, &flags)) return NULL; spec = rpmSpecParse(specfile, flags, NULL); -- 2.7.4