]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Destroy all files in repository directory
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2021 16:30:31 +0000 (16:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2021 16:30:31 +0000 (16:30 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/pakfire.c
src/libpakfire/repo.c

index 1f1daf26a99578827e3014589a7476d8d0a5bd09..dfbcb9dc740adf20eb47665bbb0ce784c95b28d4 100644 (file)
@@ -69,8 +69,6 @@ PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name);
 PakfirePackageList pakfire_whatprovides(Pakfire pakfire, const char* provides, int flags);
 PakfirePackageList pakfire_search(Pakfire pakfire, const char* what, int flags);
 
-int pakfire_cache_destroy(Pakfire pakfire, const char* path);
-
 // Logging
 
 int pakfire_log_get_priority(Pakfire pakfire);
index c6e4db7a177612eec1a6df8cff4fa7433a3c0de5..e6c4bcb50a6b256bc3ae6555dab5fb6b0558ca2a 100644 (file)
@@ -1427,15 +1427,6 @@ int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
        return 0;
 }
 
-PAKFIRE_EXPORT int pakfire_cache_destroy(Pakfire pakfire, const char* path) {
-       char cache_path[PATH_MAX];
-
-       pakfire_make_cache_path(pakfire, cache_path, "%s", path);
-
-       // Completely delete the tree of files
-       return pakfire_rmtree(cache_path, 0);
-}
-
 PAKFIRE_EXPORT int pakfire_log_get_priority(Pakfire pakfire) {
        return pakfire->log_priority;
 }
index f9176cbb40041fb091fe95cda2765131e9dc0233..70faf088cc9da605baf65ccff05499644858e39d 100644 (file)
@@ -802,12 +802,13 @@ PAKFIRE_EXPORT PakfirePackage pakfire_repo_add_archive(PakfireRepo repo, Pakfire
 PAKFIRE_EXPORT int pakfire_repo_clean(PakfireRepo repo) {
        char cache_path[PATH_MAX];
 
+       // Destroy all files in the cache directory
        int r = pakfire_make_cache_path(repo->pakfire, cache_path,
                "%s", pakfire_repo_get_name(repo));
        if (r < 0)
                return r;
 
-       return pakfire_cache_destroy(repo->pakfire, cache_path);
+       return pakfire_rmtree(cache_path, 0);
 }
 
 static int pakfire_repo_scan_file(PakfireRepo repo, const char* path) {