From 585ec63712c81159541c72ee7e8b46ff84d5f9a1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 1 Jun 2023 16:41:45 +0000 Subject: [PATCH] _pakfire: Drop listing keys We no longer keep keys stored. Signed-off-by: Michael Tremer --- src/_pakfire/pakfire.c | 53 ------------------------------------------ 1 file changed, 53 deletions(-) diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index 8154a59cd..510a75bb4 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -595,52 +595,6 @@ static PyObject* Pakfire_update(PakfireObject* self, PyObject* args, PyObject* k Py_RETURN_NONE; } -static PyObject* Pakfire_keys_to_list(struct pakfire_key** keys) { - PyObject* list = PyList_New(0); - - // Empty input? - if (!keys) - return list; - - // Push all keys onto the list - for (struct pakfire_key** key = keys; *key; key++) { - PyObject* object = new_key(&KeyType, *key); - if (!object) - goto ERROR; - - PyList_Append(list, object); - Py_DECREF(object); - } - - return list; - -ERROR: - Py_DECREF(list); - return NULL; -} - -static PyObject* Pakfire_get_keys(PakfireObject* self) { - struct pakfire_key** keys = NULL; - - int r = pakfire_list_keys(self->pakfire, &keys); - if (r) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; - } - - // Convert keys to list - PyObject* list = Pakfire_keys_to_list(keys); - - // Free keys - if (keys) { - for (struct pakfire_key** key = keys; *key; key++) - pakfire_key_unref(*key); - free(keys); - } - - return list; -} - static PyObject* Pakfire_generate_key(PakfireObject* self, PyObject* args, PyObject* kwds) { char* kwlist[] = { "algorithm", NULL }; struct pakfire_key* key = NULL; @@ -1610,13 +1564,6 @@ static struct PyGetSetDef Pakfire_getsetters[] = { NULL, NULL }, - { - "keys", - (getter)Pakfire_get_keys, - NULL, - NULL, - NULL - }, { "path", (getter)Pakfire_get_path, -- 2.39.5