return 0;
}
-static int pakfire_build_find_dependencies(struct pakfire* pakfire,
+static int pakfire_build_find_dependencies(struct pakfire_build* build,
struct pakfire_package* pkg, struct pakfire_filelist* filelist, const char* buildroot) {
char** provides = NULL;
char** requires = NULL;
char path[PATH_MAX];
// Allocate path to write the filelist to
- int r = pakfire_make_path(pakfire, path, "tmp/.pakfire-filelist.XXXXXX");
+ int r = pakfire_make_path(build->pakfire, path, "tmp/.pakfire-filelist.XXXXXX");
if (r < 0)
return 1;
r = pakfire_filelist_export(filelist, f);
fclose(f);
if (r) {
- ERROR(pakfire, "Could not export filelist: %m\n");
+ ERROR(build->pakfire, "Could not export filelist: %m\n");
goto ERROR;
}
- const char* root = pakfire_get_path(pakfire);
+ const char* root = pakfire_get_path(build->pakfire);
// Pass buildroot and the filelist as arguments
const char* args[] = {
};
// Find all provides
- r = pakfire_build_run_script(pakfire, "find-provides", args, &provides);
+ r = pakfire_build_run_script(build->pakfire, "find-provides", args, &provides);
if (r) {
- ERROR(pakfire, "find-provides returned with error %d\n", r);
+ ERROR(build->pakfire, "find-provides returned with error %d\n", r);
goto ERROR;
}
// Find all requires
- r = pakfire_build_run_script(pakfire, "find-requires", args, &requires);
+ r = pakfire_build_run_script(build->pakfire, "find-requires", args, &requires);
if (r) {
- ERROR(pakfire, "find-requires returned with error %d\n", r);
+ ERROR(build->pakfire, "find-requires returned with error %d\n", r);
goto ERROR;
}
// Add all provides to the package
if (provides) {
for (char** element = provides; *element; element++) {
- DEBUG(pakfire, "Adding provides: %s\n", *element);
+ DEBUG(build->pakfire, "Adding provides: %s\n", *element);
pakfire_package_add_provides(pkg, *element);
}
}
if (find_dependency(provides, *element))
continue;
- DEBUG(pakfire, "Adding requires: %s\n", *element);
+ DEBUG(build->pakfire, "Adding requires: %s\n", *element);
pakfire_package_add_requires(pkg, *element);
}
}
goto ERROR;
// Find dependencies
- r = pakfire_build_find_dependencies(build->pakfire, pkg, filelist, buildroot);
+ r = pakfire_build_find_dependencies(build, pkg, filelist, buildroot);
if (r) {
ERROR(build->pakfire, "Finding dependencies failed: %m\n");
goto ERROR;