From: Michael Tremer Date: Mon, 14 Jun 2021 11:14:17 +0000 (+0000) Subject: Remove some unused Python bindung functions and make them private X-Git-Tag: 0.9.28~1256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8015584b210a08eb395388c75acaad437fb8dcf;p=pakfire.git Remove some unused Python bindung functions and make them private Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index 1887847c8..4ec0f8071 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -164,17 +164,6 @@ static PyObject* Pakfire_get_repo(PakfireObject* self, PyObject* args) { return obj; } -static PyObject* Pakfire_get_installed_repo(PakfireObject* self) { - PakfireRepo repo = pakfire_get_installed_repo(self->pakfire); - if (!repo) - Py_RETURN_NONE; - - PyObject* obj = new_repo(&RepoType, repo); - pakfire_repo_unref(repo); - - return obj; -} - static PyObject* _import_keylist(PakfireObject* pakfire, PakfireKey* keys) { PyObject* list = PyList_New(0); @@ -760,23 +749,6 @@ ERROR: return list; } -static PyObject* Pakfire_make_cache_path(PakfireObject* self, PyObject* args) { - const char* path = NULL; - - if (!PyArg_ParseTuple(args, "s", &path)) - return NULL; - - char cache_path[PATH_MAX]; - - int r = pakfire_make_cache_path(self->pakfire, cache_path, "%s", path); - if (r) { - PyErr_SetFromErrno(PyExc_OSError); - return NULL; - } - - return PyUnicode_FromString(cache_path); -} - static PyObject* execute_return_value(int r) { // Raise an OS error if r < 0 if (r < 0) { @@ -904,12 +876,6 @@ static struct PyMethodDef Pakfire_methods[] = { METH_VARARGS, NULL }, - { - "make_cache_path", - (PyCFunction)Pakfire_make_cache_path, - METH_VARARGS, - NULL - }, { "read_makefile", (PyCFunction)Pakfire_read_makefile, @@ -957,13 +923,6 @@ static struct PyGetSetDef Pakfire_getsetters[] = { NULL, NULL }, - { - "installed_repo", - (getter)Pakfire_get_installed_repo, - NULL, - NULL, - NULL - }, { "installonly", (getter)Pakfire_get_installonly, diff --git a/src/libpakfire/include/pakfire/pakfire.h b/src/libpakfire/include/pakfire/pakfire.h index 43a395fe6..456a7361b 100644 --- a/src/libpakfire/include/pakfire/pakfire.h +++ b/src/libpakfire/include/pakfire/pakfire.h @@ -47,12 +47,6 @@ Pakfire pakfire_unref(Pakfire pakfire); const char* pakfire_get_path(Pakfire pakfire); -#define pakfire_make_cache_path(pakfire, path, format, ...) \ - __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__) - -int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length, - const char* format, ...) __attribute__((format(printf, 4, 5))); - int pakfire_bind(Pakfire pakfire, const char* src, const char* dst, int flags); int pakfire_copy_in(Pakfire pakfire, const char* src, const char* dst); @@ -69,7 +63,6 @@ size_t pakfire_count_packages(Pakfire pakfire); struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire); PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name); -PakfireRepo pakfire_get_installed_repo(Pakfire pakfire); PakfirePackageList pakfire_whatprovides(Pakfire pakfire, const char* provides, int flags); PakfirePackageList pakfire_search(Pakfire pakfire, const char* what, int flags); @@ -113,12 +106,20 @@ const char* pakfire_get_distro_version_id(Pakfire pakfire); __pakfire_make_path(pakfire, dst, sizeof(dst) - 1, path) int __pakfire_make_path(Pakfire pakfire, char* dst, size_t length, const char* path); +#define pakfire_make_cache_path(pakfire, path, format, ...) \ + __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__) + +int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length, + const char* format, ...) __attribute__((format(printf, 4, 5))); + void pakfire_pool_has_changed(Pakfire pakfire); void pakfire_pool_apply_changes(Pakfire pakfire); Pool* pakfire_get_solv_pool(Pakfire pakfire); Queue* pakfire_get_installonly_queue(Pakfire pakfire); +PakfireRepo pakfire_get_installed_repo(Pakfire pakfire); + // Archive helpers struct archive* pakfire_make_archive_disk_reader(Pakfire pakfire, int internal); struct archive* pakfire_make_archive_disk_writer(Pakfire pakfire); diff --git a/src/libpakfire/libpakfire.sym b/src/libpakfire/libpakfire.sym index 19c6c4b65..a3543db6a 100644 --- a/src/libpakfire/libpakfire.sym +++ b/src/libpakfire/libpakfire.sym @@ -30,7 +30,6 @@ global: pakfire_execute_command; pakfire_execute_script; pakfire_get_arch; - pakfire_get_installed_repo; pakfire_get_installonly; pakfire_get_path; pakfire_get_pool; @@ -44,7 +43,6 @@ global: pakfire_unref; pakfire_version_compare; pakfire_whatprovides; - __pakfire_make_cache_path; # arch pakfire_arch_native; diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 6a842388e..0e45750cc 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -1237,7 +1237,7 @@ PAKFIRE_EXPORT PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name) { return NULL; } -PAKFIRE_EXPORT PakfireRepo pakfire_get_installed_repo(Pakfire pakfire) { +PakfireRepo pakfire_get_installed_repo(Pakfire pakfire) { if (!pakfire->pool->installed) return NULL; @@ -1366,7 +1366,7 @@ PAKFIRE_EXPORT PakfirePackageList pakfire_search(Pakfire pakfire, const char* wh // Cache -PAKFIRE_EXPORT int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length, +int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length, const char* format, ...) { va_list args;