From 4703a4c99defaed0736f5bfd7e7b63d741664173 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 11 Jan 2025 18:41:43 +0000 Subject: [PATCH] snapshots: Always try to clean up after we created a new snapshot Signed-off-by: Michael Tremer --- src/pakfire/pakfire.c | 5 ----- src/pakfire/snapshot.c | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) 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); -- 2.47.3