]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Drop any content from memory when cleaning
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2021 16:45:33 +0000 (16:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Jun 2021 16:45:33 +0000 (16:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/repo.c

index da9d0e106ba1bae4e1cb18a197df8c9d4f8cbc2d..d562a20965b6c2a6a3c3308d4e094aa4ebf459d5 100644 (file)
@@ -810,6 +810,17 @@ PAKFIRE_EXPORT PakfirePackage pakfire_repo_add_archive(PakfireRepo repo, Pakfire
 PAKFIRE_EXPORT int pakfire_repo_clean(PakfireRepo repo) {
        char cache_path[PATH_MAX];
 
+       // Drop all meta-data from memory
+       repo_empty(repo->repo, 0);
+
+       // End here for all "internal" repositories
+       if (pakfire_repo_is_internal(repo))
+               return 0;
+
+       // Do not destroy files in local repositories
+       if (pakfire_repo_is_local(repo))
+               return 0;
+
        // Destroy all files in the cache directory
        int r = pakfire_make_cache_path(repo->pakfire, cache_path,
                "%s", pakfire_repo_get_name(repo));