]> git.ipfire.org Git - pakfire.git/commitdiff
Parse relations in libpakfire
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Jun 2019 19:30:44 +0000 (20:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Jun 2019 19:30:44 +0000 (20:30 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/relation.c
src/libpakfire/libpakfire.sym

index 5c6cfd4cac35444cbbe4f64acc6490f2404b31ef..215aea6ee5e11697b106e1f88e1b20e449d736e5 100644 (file)
@@ -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;
        }
 
index 663d8f0503f0585879a6e47c9462bf6df3f41b4f..32c2ec3f7b63dc5a6886536687157d64ccd7c477 100644 (file)
@@ -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;