From: Michael Tremer Date: Mon, 10 Jun 2019 19:30:44 +0000 (+0100) Subject: Parse relations in libpakfire X-Git-Tag: 0.9.28~1285^2~951 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5049794915ec82936c4153ea4682025fa150209;p=pakfire.git Parse relations in libpakfire Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/relation.c b/src/_pakfire/relation.c index 5c6cfd4ca..215aea6ee 100644 --- a/src/_pakfire/relation.c +++ b/src/_pakfire/relation.c @@ -55,16 +55,14 @@ static void Relation_dealloc(RelationObject* self) { static int Relation_init(RelationObject* self, PyObject* args, PyObject* kwds) { PakfireObject* pakfire; - const char* name; - const char* evr = NULL; - int cmp_type = 0; + const char* relation; - if (!PyArg_ParseTuple(args, "O!s|is", &PakfireType, &pakfire, &name, &cmp_type, &evr)) + if (!PyArg_ParseTuple(args, "O!s", &PakfireType, &pakfire, &relation)) return -1; - self->relation = pakfire_relation_create(pakfire->pakfire, name, cmp_type, evr); + self->relation = pakfire_relation_create_from_string(pakfire->pakfire, relation); if (!self->relation) { - PyErr_Format(PyExc_ValueError, "No such relation: %s", name); + PyErr_Format(PyExc_ValueError, "No such relation: %s", relation); return -1; } diff --git a/src/libpakfire/libpakfire.sym b/src/libpakfire/libpakfire.sym index 663d8f050..32c2ec3f7 100644 --- a/src/libpakfire/libpakfire.sym +++ b/src/libpakfire/libpakfire.sym @@ -278,6 +278,7 @@ global: # relation pakfire_relation_create; pakfire_relation_create_from_id; + pakfire_relation_create_from_string; pakfire_relation_get_id; pakfire_relation_providers; pakfire_relation_ref;