#include <glob.h>
#include <stdlib.h>
#include <sys/mount.h>
+#include <unistd.h>
#include <pakfire/build.h>
#include <pakfire/execute.h>
const char* target, const char* id, int flags,
pakfire_execute_logging_callback logging_callback, void* data) {
char makefiles[PATH_MAX];
+ char cwd[PATH_MAX];
char* generated_id = NULL;
glob_t buffer;
int r = 1;
// The default target is the local repository path
if (!target) {
PakfireRepo repo = pakfire_get_repo(pakfire, "@local");
- if (!repo) {
- errno = EINVAL;
- return 1;
- }
+ if (repo) {
+ target = pakfire_repo_get_path(repo);
+ pakfire_repo_unref(repo);
- target = pakfire_repo_get_path(repo);
- pakfire_repo_unref(repo);
+ // If the repository could not be found, just write to the cwd
+ } else {
+ target = getcwd(cwd, sizeof(cwd));
+ }
}
// If no build ID was passed, we generate a random one