From 119d56047e5bd49c42ca7378a332707c021a81cc Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Mon, 7 Sep 2026 13:47:57 +0200 Subject: remove testing repo, begin testing with main repo --- Makefile | 1 - config.lua.example | 2 +- src/repo.c | 29 ++++++++++++++++++++++++++--- testing/README.md | 1 - testing/sys-build/samurai/1.3.lua | 36 ------------------------------------ 5 files changed, 27 insertions(+), 42 deletions(-) delete mode 100644 testing/README.md delete mode 100644 testing/sys-build/samurai/1.3.lua diff --git a/Makefile b/Makefile index 70e3f42..09b4fbb 100644 --- a/Makefile +++ b/Makefile @@ -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", }, } diff --git a/src/repo.c b/src/repo.c index 3dfa985..846136c 100644 --- a/src/repo.c +++ b/src/repo.c @@ -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 -- cgit v1.3