From: Michael Tremer Date: Sat, 9 Sep 2023 10:51:30 +0000 (+0000) Subject: archive: Ensure the target directory exists X-Git-Tag: 0.9.29~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f4cb887198a2dc4c49cd93bf4f8fa7c34c5d7ca;p=pakfire.git archive: Ensure the target directory exists This causes that we could not hard-link any repositories since we put archives into subdirectories resulting in a lot of unnecessary IO. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/archive.c b/src/libpakfire/archive.c index 2152fd0d2..197293a0f 100644 --- a/src/libpakfire/archive.c +++ b/src/libpakfire/archive.c @@ -782,6 +782,11 @@ static int pakfire_archive_link(struct pakfire_archive* archive, const char* pat int pakfire_archive_link_or_copy(struct pakfire_archive* archive, const char* path) { int r; + // Make sure the parent directory exists + r = pakfire_mkparentdir(path, 0755); + if (r) + return r; + // Try to create a hardlink r = pakfire_archive_link(archive, path); switch (-r) {