]> git.ipfire.org Git - pakfire.git/commitdiff
Remove some unused Python bindung functions and make them private
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 11:14:17 +0000 (11:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 11:14:17 +0000 (11:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/libpakfire.sym
src/libpakfire/pakfire.c

index 1887847c874be51606954dc64274ca5a0d7fb380..4ec0f807177e8aabbbbf058765aec3a91fbbf481 100644 (file)
@@ -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,
index 43a395fe6580a906fd8fcc345695474fea0f00c5..456a7361b69de6d84639074daba16d33b8461b1e 100644 (file)
@@ -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);
index 19c6c4b65163b9c8f1f93d32815643e073373600..a3543db6a4ada82f5e3c0a493a8ed3a9aea2254e 100644 (file)
@@ -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;
index 6a842388ed71d4c21d620532e47210b9906ae3ae..0e45750cc810371f1c77c355b23c4f5295bdaa7c 100644 (file)
@@ -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;