From f41ca03c214671f49dc89e0e885c842f55cd6770 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 29 Jun 2025 16:41:51 +0000 Subject: [PATCH] root: Remove the version comparison function This exists in the Python module as a separate thing now and we don't gain anything any more from having a second function that is tied to another pool. Signed-off-by: Michael Tremer --- src/pakfire/root.c | 4 ---- src/pakfire/root.h | 2 -- src/python/root.c | 18 ------------------ 3 files changed, 24 deletions(-) diff --git a/src/pakfire/root.c b/src/pakfire/root.c index 24537733..3f460345 100644 --- a/src/pakfire/root.c +++ b/src/pakfire/root.c @@ -1320,10 +1320,6 @@ const char* pakfire_root_get_effective_arch(pakfire_root* self) { return self->arches.effective; } -int pakfire_root_version_compare(pakfire_root* self, const char* evr1, const char* evr2) { - return pool_evrcmp_str(self->pool, evr1, evr2, EVRCMP_COMPARE); -} - Pool* pakfire_root_get_solv_pool(pakfire_root* self) { return self->pool; } diff --git a/src/pakfire/root.h b/src/pakfire/root.h index 4b469d49..2c0844dd 100644 --- a/src/pakfire/root.h +++ b/src/pakfire/root.h @@ -66,8 +66,6 @@ int pakfire_root_clean(pakfire_root* pakfire, int flags); const char* pakfire_root_get_arch(pakfire_root* pakfire); -int pakfire_root_version_compare(pakfire_root* pakfire, const char* evr1, const char* evr2); - pakfire_repo* pakfire_root_get_repo(pakfire_root* pakfire, const char* name); int pakfire_root_whatprovides(pakfire_root* pakfire, const char* what, int flags, diff --git a/src/python/root.c b/src/python/root.c index 22f79e3b..3709d55d 100644 --- a/src/python/root.c +++ b/src/python/root.c @@ -344,18 +344,6 @@ ERROR: return ret; } -static PyObject* Root_version_compare(RootObject* self, PyObject* args) { - const char* evr1 = NULL; - const char* evr2 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &evr1, &evr2)) - return NULL; - - int cmp = pakfire_root_version_compare(self->root, evr1, evr2); - - return PyLong_FromLong(cmp); -} - static PyObject* Root_dist(RootObject* self, PyObject* args) { pakfire_archive* archive = NULL; const char* path = NULL; @@ -846,12 +834,6 @@ static struct PyMethodDef Root_methods[] = { METH_VARARGS|METH_KEYWORDS, NULL }, - { - "version_compare", - (PyCFunction)Root_version_compare, - METH_VARARGS, - NULL - }, { "whatprovides", (PyCFunction)Root_whatprovides, -- 2.47.3