diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | config.lua.example | 2 | ||||
| -rw-r--r-- | src/repo.c | 29 | ||||
| -rw-r--r-- | testing/README.md | 1 | ||||
| -rw-r--r-- | testing/sys-build/samurai/1.3.lua | 36 |
5 files changed, 27 insertions, 42 deletions
@@ -42,4 +42,3 @@ $(TARGET): $(OBJ_FILES) clean: $(RM) $(OUT_DIR) $(TARGET)$(BIN_EXT) - diff --git a/config.lua.example b/config.lua.example index 735c404..d3b21dc 100644 --- a/config.lua.example +++ b/config.lua.example @@ -2,7 +2,7 @@ local config = {} config.repos = { { - path = "./testing", + path = "/var/lib/pow/repos", }, } @@ -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); } diff --git a/testing/README.md b/testing/README.md deleted file mode 100644 index f3c6a3f..0000000 --- a/testing/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a dummy repository used for testing. diff --git a/testing/sys-build/samurai/1.3.lua b/testing/sys-build/samurai/1.3.lua deleted file mode 100644 index 732ad89..0000000 --- a/testing/sys-build/samurai/1.3.lua +++ /dev/null @@ -1,36 +0,0 @@ -local package = {} - -local lfs = require("lfs") - -package.name = "samurai" -package.version = "1.3" -package.description = "ninja compatible build tool written in C" -package.arch = { "x86_64" } -package.license = { "MIT", "Apache", "ISC" } - -package.deps = { - build = { - { provides = "cc" }, - { provides = "make" }, - }, -} - -package.sources = { - { - path = "https://github.com/michaelforney/samurai/releases/download/1.3/samurai-1.3.tar.gz", - hash = "1bc020a9e133432df51911ac71cc34322f828934d9a2282ba2916d88c15976af", - out = "source.tar.gz", - }, -} - -package.build = function() - print(lfs.currentdir()) - - pow.extract("source.tar.gz", "source") - - lfs.chdir("source/samurai-1.3") - - os.execute("make") -end - -return package |
