]> git.ipfire.org Git - pakfire.git/commitdiff
snapshots: Automatically create a new snapshot if there are none
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 15:18:46 +0000 (15:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Oct 2024 15:18:46 +0000 (15:18 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/snapshot.c

index 0aef6cfc3c740fb24c1d70d8b54b4af9386888d1..cdd12210ae20e0d9bfab99e13a0e0f8ddb71df1b 100644 (file)
@@ -178,9 +178,13 @@ int pakfire_snapshot_find(struct pakfire_snapshot** snapshot, struct pakfire* pa
                r = num_paths;
                goto ERROR;
 
-       // We are done if we did not find anything
+       // Create a new snapshot if none was found
        } else if (num_paths == 0) {
-               r = 0;
+               r = pakfire_snapshot_make(snapshot, pakfire);
+               if (r < 0)
+                       goto ERROR;
+
+               // Anyways, we are done
                goto ERROR;
        }