From 76ee567986a12c22e6a606d74e31425facf9f5f4 Mon Sep 17 00:00:00 2001 From: dacctal Date: Fri, 17 Jul 2026 01:50:49 +0000 Subject: can install/remove packages, doesn't segfault (?) --- src/pkg_remove.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pkg_remove.c') diff --git a/src/pkg_remove.c b/src/pkg_remove.c index 1d4be14..bec7a8f 100644 --- a/src/pkg_remove.c +++ b/src/pkg_remove.c @@ -164,7 +164,7 @@ static int remove_tree( return 0; } -void remove_pkg(package_t *pkg) { +void pkg_remove(package_t *pkg) { if (!is_directory(pkg->src.data)) { log_error("%.*s is not installed!", str_fmt(&pkg->name)); return; @@ -179,11 +179,13 @@ void remove_pkg(package_t *pkg) { if (!uninstall_available) if (config_uninstall(pkg)) uninstall_available = true; - if (!uninstall_available) + if (!uninstall_available) { log_error( "no uninstall function availible for package: %.*s", str_fmt(&pkg->name) ); + return; + } nftw(pkg->src.data, remove_installed, 64, FTW_PHYS); const char *last_slash = strrchr(pkg->src.data, '/'); @@ -195,5 +197,5 @@ void remove_pkg(package_t *pkg) { snprintf(target, sizeof(target), "%s", pkg->src.data); } nftw(pkg->src.data, remove_tree, 64, FTW_DEPTH | FTW_PHYS); - log_success("removed %s", str_fmt(&pkg->name)); + log_success("removed %.*s", str_fmt(&pkg->name)); } -- cgit v1.2.3