]> git.ipfire.org Git - pakfire.git/commitdiff
build: Ensure the ccache directory exists or create it
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 17:40:47 +0000 (17:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 17:40:47 +0000 (17:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/build.c

index 12887f7795a8c56eeb0d9283ea8b23d00cb1450d..10eb47ffc07d53f7e8e9bf2e088ca2771f878d72 100644 (file)
@@ -1884,6 +1884,14 @@ static int pakfire_build_setup_ccache(struct pakfire_build* build) {
        if (r)
                return r;
 
+       // Ensure the directory exist
+       r = pakfire_mkdir(build->ccache_path, 0755);
+       if (r < 0) {
+               ERROR(build->ctx, "Could not create ccache %s: %s\n",
+                               build->ccache_path, strerror(-r));
+               return r;
+       }
+
        // Bind-mount the directory into the jail
        r = pakfire_jail_bind(build->jail, build->ccache_path, CCACHE_DIR,
                        MS_NOSUID|MS_NOEXEC|MS_NODEV);