]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
repo: compose: Ensure that the destination path always exists
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Mar 2023 15:34:35 +0000 (15:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Mar 2023 15:34:35 +0000 (15:34 +0000)
realpath() fails if the destination does not exist, so we will try to
create it before.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/repo.c

index bd467ccea217fb094afeb76d33fcbfd1ab786f98..74ea6f570821cb4005ff28dc0b0625f0842bc566 100644 (file)
@@ -1522,6 +1522,9 @@ PAKFIRE_EXPORT int pakfire_repo_compose(struct pakfire* pakfire, const char* pat
                        num_files++;
        }
 
+       // Create the destination if it doesn't exist, yet
+       pakfire_mkdir(path, 0755);
+
        // Make path absolute
        r = pakfire_path_realpath(realpath, path);
        if (r)