From fa9e048dc65f246c165d820b983baf62d201c264 Mon Sep 17 00:00:00 2001 From: dacctal Date: Tue, 25 Aug 2026 13:46:17 +0000 Subject: [checkpoint] small changes that i'm pretty sure break reinstalls --- src/hooks.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/hooks.c') diff --git a/src/hooks.c b/src/hooks.c index 18ad31c..20923b7 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -90,8 +90,11 @@ str pkg_get_latest_version(package_t *pkg) { str version = str_new(); if (!pkg_hook_fetch_latest_version(pkg)) return version; - if (lua_isstring(L, -1)) - version = mstr(lua_tostring(L, -1)); + if (lua_isstring(L, -1)) { + str tmp_version = mstr(lua_tostring(L, -1)); + str_copy_into(&version, &tmp_version); + str_free(&tmp_version); + } lua_pop(L, 4); return version; } @@ -111,28 +114,23 @@ bool pkg_hook_recipe(char *recipe, package_t *pkg) { } bool pkg_hook_setup(package_t *pkg) { - pkg_hook_recipe("setup", pkg); - return true; + return pkg_hook_recipe("setup", pkg); } bool pkg_hook_build(package_t *pkg) { - pkg_hook_recipe("build", pkg); - return true; + return pkg_hook_recipe("build", pkg); } bool pkg_hook_install(package_t *pkg) { - pkg_hook_recipe("install", pkg); - return true; + return pkg_hook_recipe("install", pkg); } bool pkg_hook_remove(package_t *pkg) { - pkg_hook_recipe("remove", pkg); - return true; + return pkg_hook_recipe("remove", pkg); } bool pkg_hook_on_update(package_t *pkg) { - pkg_hook_recipe("on_update", pkg); - return true; + return pkg_hook_recipe("on_update", pkg); } bool config_hook_on_update(void) { -- cgit v1.2.3