From: Michael Tremer Date: Sat, 11 Jan 2025 18:41:43 +0000 (+0000) Subject: snapshots: Always try to clean up after we created a new snapshot X-Git-Tag: 0.9.30~421 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4703a4c99defaed0736f5bfd7e7b63d741664173;p=pakfire.git snapshots: Always try to clean up after we created a new snapshot Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/pakfire.c b/src/pakfire/pakfire.c index 1f7702876..e76732940 100644 --- a/src/pakfire/pakfire.c +++ b/src/pakfire/pakfire.c @@ -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); diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index a09c71548..51242ff1e 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -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);