diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-07-04 07:09:53 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-07-04 07:09:53 +0000 |
| commit | bf9cabdd5a09dc5a430858bca9991badf8a2a719 (patch) | |
| tree | 12e34ee9a8b9e378782c1e0de89cdb1997e43959 /src/lua_install.c | |
| parent | 2de72d84ec65960724f0d769588c95d110fca020 (diff) | |
pkg_install checkpoint!
Diffstat (limited to 'src/lua_install.c')
| -rw-r--r-- | src/lua_install.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lua_install.c b/src/lua_install.c index 1170323..4b12c2f 100644 --- a/src/lua_install.c +++ b/src/lua_install.c @@ -53,10 +53,10 @@ void install_dependencies(lua_State *L) { } } -bool target_loop_install(lua_State *L, char* lua_file, str *target) { +bool target_install(lua_State *L, char* lua_file, str *target) { if (!lua_try_table(L, lua_file, target->data)) return false; lua_try_function(L, lua_file, "pre_install"); - lua_try_function(L, lua_file, "install"); + if (!lua_try_function(L, lua_file, "install")) return false; lua_try_function(L, lua_file, "post_install"); lua_pop(L, 1); return true; @@ -74,9 +74,9 @@ bool repo_install(package_t *pkg) { return false; } if (!lua_try_table(L, "init.lua", "targets")) return false; - bool target_loop_success = target_loop_install(L, "init.lua", &pkg->target); + bool target_success = target_install(L, "init.lua", &pkg->target); lua_pop(L, 3); - return target_loop_success; + return target_success; } bool bldit_install(package_t *pkg) { @@ -90,16 +90,16 @@ bool bldit_install(package_t *pkg) { lua_setglobal(B, "prefix"); lua_pop(B, 1); lua_try_table(L, "bldit.lua", "targets"); - bool target_loop_success = target_loop_install(B, "bldit.lua", &pkg->target); + bool target_success = target_install(B, "bldit.lua", &pkg->target); lua_pop(B, 1); lua_close(B); - return target_loop_success; + return target_success; } bool config_install(package_t *pkg) { lua_getglobal(L, "build_systems"); lua_pushnil(L); - bool target_loop_success = false; + bool target_success = false; while (lua_next(L, -2) != 0) { const char *key = lua_tostring(L, -2); if (!lua_istable(L, -1)) { @@ -113,11 +113,11 @@ bool config_install(package_t *pkg) { } str_free(&file_path); lua_try_table(L, "init.lua", "targets"); - target_loop_success = target_loop_install(L, "init.lua", &pkg->target); + target_success = target_install(L, "init.lua", &pkg->target); lua_pop(L, 2); } lua_pop(L, 1); - return target_loop_success; + return target_success; } void pkg_install(package_t *pkg) { |
