uuid_t id;
char _id[UUID_STR_LEN];
+ char target[PATH_MAX];
+
// cgroup
struct pakfire_cgroup* cgroup;
return 0;
}
+/*
+ Sets the default target
+*/
+static int pakfire_build_set_default_target(struct pakfire_build* build) {
+ // Look for the "local" repository
+ struct pakfire_repo* repo = pakfire_get_repo(build->pakfire, PAKFIRE_REPO_LOCAL);
+ if (repo) {
+ const char* target = pakfire_repo_get_path(repo);
+ if (target)
+ pakfire_string_set(build->target, target);
+
+ pakfire_repo_unref(repo);
+ }
+
+ // Default to the current working directory
+ if (!*build->target) {
+ char* cwd = getcwd(build->target, sizeof(build->target));
+ if (!cwd) {
+ ERROR(build->pakfire, "getcwd() failed: %m\n");
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
/*
Sets up a new cgroup for this build
*/
if (r)
goto ERROR;
+ // Set target
+ r = pakfire_build_set_default_target(b);
+ if (r)
+ goto ERROR;
+
// Create cgroup
r = pakfire_build_setup_cgroup(b);
if (r)