return r;
}
-static int pakfire_build_stage(struct pakfire* pakfire, struct pakfire_parser* makefile, const char* stage) {
+static int pakfire_build_stage(struct pakfire_build* build,
+ struct pakfire_parser* makefile, const char* stage) {
struct pakfire_jail* jail = NULL;
char template[1024];
// Create the build script
char* script = pakfire_parser_expand(makefile, "build", template);
if (!script) {
- ERROR(pakfire, "Could not generate the build script for stage '%s': %m\n", stage);
+ ERROR(build->pakfire, "Could not generate the build script for stage '%s': %m\n",
+ stage);
goto ERROR;
}
- INFO(pakfire, "Running build stage '%s'\n", stage);
+ INFO(build->pakfire, "Running build stage '%s'\n", stage);
// Create a new jail
- jail = pakfire_build_make_jail(pakfire);
+ jail = pakfire_build_make_jail(build->pakfire);
if (!jail)
goto ERROR;
// Import environment
r = pakfire_jail_import_env(jail, (const char**)envp);
if (r) {
- ERROR(pakfire, "Could not import environment: %m\n");
+ ERROR(build->pakfire, "Could not import environment: %m\n");
goto ERROR;
}
// Run the script
r = pakfire_jail_exec_script(jail, script, strlen(script), NULL, NULL);
if (r) {
- ERROR(pakfire, "Build stage '%s' failed with status %d\n", stage, r);
+ ERROR(build->pakfire, "Build stage '%s' failed with status %d\n", stage, r);
}
ERROR:
// Run through all build stages
for (const char** stage = stages; *stage; stage++) {
- r = pakfire_build_stage(build->pakfire, makefile, *stage);
+ r = pakfire_build_stage(build, makefile, *stage);
if (r) {
// Drop to a shell for debugging
if (pakfire_has_flag(build->pakfire, PAKFIRE_FLAGS_INTERACTIVE))