summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-09-01 16:59:22 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-09-01 16:59:22 +0300
commitcbd5d98a8416a1f6c875cde82f3f1c3b02c120d7 (patch)
treeefab0071ae7c9e0ade2c7ffccc4f0c973f5a16cd /python
parentc7ccdea6386b9f9cd8be5ff459be99955b56f2ef (diff)
downloadlibrpm-tizen-cbd5d98a8416a1f6c875cde82f3f1c3b02c120d7.tar.gz
librpm-tizen-cbd5d98a8416a1f6c875cde82f3f1c3b02c120d7.tar.bz2
librpm-tizen-cbd5d98a8416a1f6c875cde82f3f1c3b02c120d7.zip
Update callers to use the new rpmSpecParse() interface
Diffstat (limited to 'python')
-rw-r--r--python/spec-py.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/python/spec-py.c b/python/spec-py.c
index 1573ed0f8..af01e1f50 100644
--- a/python/spec-py.c
+++ b/python/spec-py.c
@@ -213,35 +213,23 @@ static PyGetSetDef spec_getseters[] = {
static PyObject *spec_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
{
- rpmts ts = NULL;
+ char * kwlist[] = {"specfile", NULL};
const char * specfile;
rpmSpec spec = NULL;
- char * buildRoot = NULL;
- int recursing = 0;
- char * passPhrase = "";
- char *cookie = NULL;
- int anyarch = 1;
- int force = 1;
- char * kwlist[] = {"specfile", NULL};
+ /* TODO: add arguments to control these */
+ rpmSpecFlags flags = (RPMSPEC_ANYARCH|RPMSPEC_FORCE);
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s:spec_new", kwlist,
&specfile))
return NULL;
- /*
- * Just how hysterical can you get? We need to create a transaction
- * set to get back the results from parseSpec()...
- */
- ts = rpmtsCreate();
- if (parseSpec(ts, specfile, NULL, buildRoot,recursing, passPhrase,
- cookie, anyarch, force) == 0) {
- spec = rpmtsSpec(ts);
- } else {
- PyErr_SetString(PyExc_ValueError, "can't parse specfile\n");
+ spec = rpmSpecParse(specfile, flags, NULL);
+ if (spec == NULL) {
+ PyErr_SetString(PyExc_ValueError, "can't parse specfile\n");
+ return NULL;
}
- rpmtsFree(ts);
- return spec ? spec_Wrap(subtype, spec) : NULL;
+ return spec_Wrap(subtype, spec);
}
PyTypeObject spec_Type = {