]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Set cache path depending on distribution
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 15:52:42 +0000 (15:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Apr 2021 15:52:42 +0000 (15:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index e37d4fdafc87bce7b4ea520db5c21b3036fb7388..7fe81c9158da83130e3eb187093a6f0e3c082715 100644 (file)
@@ -508,9 +508,6 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
        // Set path
        snprintf(p->path, sizeof(p->path) - 1, "%s", path);
 
-       // Set cache path
-       snprintf(p->cache_path, sizeof(p->cache_path) - 1, "%s", CACHE_PATH);
-
        // Set architecture
        snprintf(p->arch, sizeof(p->arch) - 1, "%s", arch);
 
@@ -536,6 +533,10 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
        if (r)
                goto ERROR;
 
+       // Set cache path
+       snprintf(p->cache_path, sizeof(p->cache_path) - 1,
+               "%s/%s/%s", CACHE_PATH, p->distro.id, p->distro.version_id);
+
        // Mount filesystems
        r = pakfire_mount(p);
        if (r)