From 83c4550a2f8ba2e2bf2e10a6e097fb20452f2b0e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 19 Jan 2018 14:32:32 +0100 Subject: [PATCH] libpakfire: Drop PakfireCache Signed-off-by: Michael Tremer --- Makefile.am | 2 - src/libpakfire/cache.c | 56 -------------------------- src/libpakfire/include/pakfire/cache.h | 43 -------------------- src/libpakfire/include/pakfire/pool.h | 2 - src/libpakfire/include/pakfire/types.h | 3 -- src/libpakfire/package.c | 2 - src/libpakfire/pakfire.c | 3 -- src/libpakfire/pool.c | 9 ----- src/libpakfire/step.c | 1 - 9 files changed, 121 deletions(-) delete mode 100644 src/libpakfire/cache.c delete mode 100644 src/libpakfire/include/pakfire/cache.h diff --git a/Makefile.am b/Makefile.am index cfe38bf93..dda193540 100644 --- a/Makefile.am +++ b/Makefile.am @@ -246,7 +246,6 @@ lib_LTLIBRARIES += \ libpakfire_la_SOURCES = \ src/libpakfire/archive.c \ - src/libpakfire/cache.c \ src/libpakfire/errno.c \ src/libpakfire/file.c \ src/libpakfire/filter.c \ @@ -270,7 +269,6 @@ libpakfire_la_SOURCES = \ pkginclude_HEADERS += \ src/libpakfire/include/pakfire/archive.h \ - src/libpakfire/include/pakfire/cache.h \ src/libpakfire/include/pakfire/constants.h \ src/libpakfire/include/pakfire/errno.h \ src/libpakfire/include/pakfire/file.h \ diff --git a/src/libpakfire/cache.c b/src/libpakfire/cache.c deleted file mode 100644 index 3ae779199..000000000 --- a/src/libpakfire/cache.c +++ /dev/null @@ -1,56 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2013 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -#############################################################################*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -PAKFIRE_EXPORT PakfireCache pakfire_cache_create(PakfirePool pool, const char* path) { - PakfireCache cache = pakfire_calloc(1, sizeof(*cache)); - - cache->pool = pool; - cache->path = pakfire_strdup(path); - - return cache; -} - -PAKFIRE_EXPORT void pakfire_cache_free(PakfireCache cache) { - pakfire_free(cache->path); - pakfire_free(cache); -} - -PAKFIRE_EXPORT const char* pakfire_cache_get_path(PakfireCache cache) { - return cache->path; -} - -PAKFIRE_EXPORT char* pakfire_cache_get_full_path(PakfireCache cache, const char* path) { - const char* cache_path = pakfire_cache_get_path(cache); - - return pakfire_path_join(cache_path, path); -} diff --git a/src/libpakfire/include/pakfire/cache.h b/src/libpakfire/include/pakfire/cache.h deleted file mode 100644 index b616da997..000000000 --- a/src/libpakfire/include/pakfire/cache.h +++ /dev/null @@ -1,43 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2013 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -#############################################################################*/ - -#ifndef PAKFIRE_CACHE_H -#define PAKFIRE_CACHE_H - -#include - -#include - -PakfireCache pakfire_cache_create(PakfirePool pool, const char* path); -void pakfire_cache_free(PakfireCache cache); - -const char* pakfire_cache_get_path(PakfireCache cache); -char* pakfire_cache_get_full_path(PakfireCache cache, const char* path); - -#ifdef PAKFIRE_PRIVATE - -struct _PakfireCache { - PakfirePool pool; - char* path; -}; - -#endif - -#endif /* PAKFIRE_CACHE_H */ diff --git a/src/libpakfire/include/pakfire/pool.h b/src/libpakfire/include/pakfire/pool.h index b864d2397..24d64ab71 100644 --- a/src/libpakfire/include/pakfire/pool.h +++ b/src/libpakfire/include/pakfire/pool.h @@ -28,8 +28,6 @@ PakfirePool pakfire_pool_create(Pakfire pakfire); PakfirePool pakfire_pool_ref(PakfirePool pool); PakfirePool pakfire_pool_unref(PakfirePool pool); -PakfireCache pakfire_pool_get_cache(PakfirePool pool); - #ifdef PAKFIRE_PRIVATE #include diff --git a/src/libpakfire/include/pakfire/types.h b/src/libpakfire/include/pakfire/types.h index 86e92a74c..2ac08149a 100644 --- a/src/libpakfire/include/pakfire/types.h +++ b/src/libpakfire/include/pakfire/types.h @@ -26,19 +26,16 @@ typedef struct _Pakfire* Pakfire; typedef struct _PakfireArchive* PakfireArchive; typedef struct _PakfireArchiveSignature* PakfireArchiveSignature; -typedef struct _PakfireCache* PakfireCache; typedef struct _PakfireFile* PakfireFile; typedef struct _PakfireFilter* PakfireFilter; typedef struct _PakfireKey* PakfireKey; typedef struct _PakfirePackage* PakfirePackage; -typedef struct _PakfirePackageCache* PakfirePackageCache; typedef struct _PakfirePackageList* PakfirePackageList; typedef struct _PakfirePool* PakfirePool; typedef struct _PakfireProblem* PakfireProblem; typedef struct _PakfireRelation* PakfireRelation; typedef struct _PakfireRelationList* PakfireRelationList; typedef struct _PakfireRepo* PakfireRepo; -typedef struct _PakfireRepoCache* PakfireRepoCache; typedef struct _PakfireRequest* PakfireRequest; typedef struct _PakfireSelector* PakfireSelector; typedef struct _PakfireSolution* PakfireSolution; diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index 19a4ad926..c7b31baf0 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -30,13 +30,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 00948d8eb..a7cb55927 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -57,9 +57,6 @@ struct _Pakfire { pakfire_log_function_t log_function; int log_priority; - // Cache - PakfireCache cache; - int nrefs; }; diff --git a/src/libpakfire/pool.c b/src/libpakfire/pool.c index aae9920cf..a86212d36 100644 --- a/src/libpakfire/pool.c +++ b/src/libpakfire/pool.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -39,7 +38,6 @@ // This is just being left here for compatibility struct _PakfirePool { Pakfire pakfire; - PakfireCache cache; int nrefs; }; @@ -82,10 +80,3 @@ PAKFIRE_EXPORT PakfirePool pakfire_pool_unref(PakfirePool pool) { Pool* pakfire_pool_get_solv_pool(PakfirePool pool) { return pakfire_get_solv_pool(pool->pakfire); } - -PAKFIRE_EXPORT PakfireCache pakfire_pool_get_cache(PakfirePool pool) { - if (pool->cache) - return pool->cache; - - return NULL; -} diff --git a/src/libpakfire/step.c b/src/libpakfire/step.c index f86e597e7..1aa7a0579 100644 --- a/src/libpakfire/step.c +++ b/src/libpakfire/step.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include -- 2.39.5