From: Michael Tremer Date: Fri, 31 Jan 2025 14:39:43 +0000 (+0000) Subject: snapshot: Create a new snapshot if the cache dir does not exist X-Git-Tag: 0.9.30~210 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46d78a072252d69e7b7566b2ba0946fd932a6b4b;p=pakfire.git snapshot: Create a new snapshot if the cache dir does not exist Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index 817c45b6..162defbe 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -216,9 +216,13 @@ int pakfire_snapshot_find(struct pakfire_snapshot** snapshot, struct pakfire* pa fd = open(path, O_DIRECTORY|O_CLOEXEC); if (fd < 0) { switch (errno) { - // If the directory does not exist, we cannot find a snapshot + // If the directory does not exist, we will make a new snapshot case ENOENT: - r = 0; + r = pakfire_snapshot_make(snapshot, pakfire); + if (r < 0) + goto ERROR; + + // Anyways, we are done goto ERROR; default: