diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/repo.c | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -42,15 +42,38 @@ int pow_repo_get_package(pow_repo **repos, size_t repo_count, pow_package *pkg, dp = opendir(package_path); - free(package_path); - if (!dp) { + free(package_path); + continue; } printf("found package %s in repo %s\n", query, repos[i]->path); - pow_package_open(pkg, "./testing/sys-build/samurai/1.3.lua"); + char *full_path = malloc(PATH_MAX); + + if (!full_path) { + free(package_path); + + printf("failed to malloc full path for build script\n"); + + return 1; + } + + written = snprintf(full_path, PATH_MAX, "%s/%s", package_path, "build.lua"); + + if (written >= PATH_MAX) { + printf("something went seriously wrong. the path for the package build " + "script %s is " + "too long?\n", + query); + + free(package_path); + + return 1; + } + + pow_package_open(pkg, full_path); closedir(dp); } |
