diff options
Diffstat (limited to 'src/hooks.c')
| -rw-r--r-- | src/hooks.c | 22 |
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) { |
