return 0;
}
-static int pakfire_build_makefile(struct pakfire* pakfire, const char* path, const char* target,
- uuid_t* build_id, int flags) {
+static int pakfire_build_makefile(struct pakfire_build* build, const char* path) {
struct pakfire_parser* makefile = NULL;
char buildroot[PATH_MAX];
struct pakfire_parser_error* error = NULL;
int r = 1;
- const char* root = pakfire_get_path(pakfire);
+ const char* root = pakfire_get_path(build->pakfire);
// Create BUILDROOT
- pakfire_make_path(pakfire, buildroot, "/tmp/.buildroot.XXXXXX");
+ pakfire_make_path(build->pakfire, buildroot, "/tmp/.buildroot.XXXXXX");
if (!pakfire_mkdtemp(buildroot))
goto ERROR;
goto ERROR;
// Read makefile
- r = pakfire_read_makefile(&makefile, pakfire, path, &error);
+ r = pakfire_read_makefile(&makefile, build->pakfire, path, &error);
if (r) {
if (error) {
- ERROR(pakfire, "Could not parse makefile %s: %s\n", path,
+ ERROR(build->pakfire, "Could not parse makefile %s: %s\n", path,
pakfire_parser_error_get_message(error));
pakfire_parser_error_unref(error);
} else {
- ERROR(pakfire, "Could not parse makefile %s: %m\n", path);
+ ERROR(build->pakfire, "Could not parse makefile %s: %m\n", path);
}
goto ERROR;
// Run through all build stages
for (const char** stage = stages; *stage; stage++) {
- r = pakfire_build_stage(pakfire, makefile, *stage);
+ r = pakfire_build_stage(build->pakfire, makefile, *stage);
if (r) {
// Drop to a shell for debugging
- if (pakfire_has_flag(pakfire, PAKFIRE_FLAGS_INTERACTIVE))
- pakfire_jail_shell(pakfire);
+ if (pakfire_has_flag(build->pakfire, PAKFIRE_FLAGS_INTERACTIVE))
+ pakfire_jail_shell(build->pakfire);
goto ERROR;
}
}
// Run post build scripts
- r = pakfire_build_run_post_build_scripts(pakfire, buildroot_rel);
+ r = pakfire_build_run_post_build_scripts(build->pakfire, buildroot_rel);
if (r)
goto ERROR;
// Create the packages
- r = pakfire_build_packages(pakfire, makefile, build_id, buildroot_rel, target);
+ r = pakfire_build_packages(build->pakfire, makefile, &build->id,
+ buildroot_rel, build->target);
if (r) {
- ERROR(pakfire, "Could not create packages: %m\n");
+ ERROR(build->pakfire, "Could not create packages: %m\n");
goto ERROR;
}
}
// Run build
- r = pakfire_build_makefile(build->pakfire, makefile, build->target,
- &build->id, build->flags);
+ r = pakfire_build_makefile(build, makefile);
if (r) {
ERROR(build->pakfire, "Could not build %s: %m\n", nevra);
goto ERROR;