]> git.ipfire.org Git - pakfire.git/commitdiff
snapshots: Always try to clean up after we created a new snapshot
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:41:43 +0000 (18:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:41:43 +0000 (18:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/pakfire.c
src/pakfire/snapshot.c

index 1f77028765c586ae1744acd55a449413b7cd7b9e..e767329401c8a9656d221351524525e70f0184fe 100644 (file)
@@ -1762,11 +1762,6 @@ int pakfire_update_snapshot(struct pakfire* pakfire) {
        if (r < 0)
                goto ERROR;
 
-       // Cleanup any old snapshots
-       r = pakfire_snapshot_clean(pakfire);
-       if (r < 0)
-               goto ERROR;
-
 ERROR:
        if (snapshot)
                pakfire_snapshot_unref(snapshot);
index a09c71548460c7a4ade479669bf24a460b4416ad..51242ff1e6283fc7d5a40ceb149ae2cc4409d2e4 100644 (file)
@@ -573,6 +573,9 @@ int pakfire_snapshot_make(struct pakfire_snapshot** snapshot, struct pakfire* pa
        if (r < 0)
                goto ERROR;
 
+       // Cleanup any older snapshots (and ignore if something goes wrong)
+       pakfire_snapshot_clean(pakfire);
+
 ERROR:
        if (p)
                pakfire_unref(p);