/*
Sets up the ccache for this build
*/
-static int pakfire_build_mount_ccache(struct pakfire_build* build) {
- int r;
-
- // Do nothing if the ccache is disabled
- if (pakfire_build_has_flag(build, PAKFIRE_BUILD_DISABLE_CCACHE))
- return 0;
-
- // Check that the path is set
- if (!*build->ccache_path)
- return -ENOTSUP;
-
- // Make sure the path exists
- r = pakfire_mkdir(build->ccache_path, 0755);
- if (r) {
- ERROR(build->ctx, "Could not create %s: %m\n", build->ccache_path);
- return r;
- }
-
- // Bind-mount the directory
- return pakfire_jail_bind(build->jail, build->ccache_path, CCACHE_DIR,
- MS_NOSUID|MS_NOEXEC|MS_NODEV);
-}
-
static int pakfire_build_setup_ccache(struct pakfire_build* build) {
int r;
if (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);
+ if (r < 0) {
+ ERROR(build->ctx, "Could not mount the ccache: %s\n", strerror(-r));
+ return r;
+ }
+
return 0;
}
goto ERROR;
}
- // Mount the ccache
- r = pakfire_build_mount_ccache(build);
- if (r) {
- ERROR(build->ctx, "Could not mount the ccache: %m\n");
- goto ERROR;
- }
-
// Open the makefile
r = pakfire_build_read_makefile(build, &makefile, package);
if (r)