aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.c
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-08-25 13:46:17 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-08-25 13:46:17 +0000
commitfa9e048dc65f246c165d820b983baf62d201c264 (patch)
treeadd08cbef5180ea83dba0d646e576fa2b68a3791 /src/hooks.c
parentd62326ee93521de490e5bc8d37bf234111187e20 (diff)
[checkpoint] small changes that i'm pretty sure break reinstalls
Diffstat (limited to 'src/hooks.c')
-rw-r--r--src/hooks.c22
1 files changed, 10 insertions, 12 deletions
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) {