diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-07-17 01:50:49 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-07-17 01:50:49 +0000 |
| commit | 76ee567986a12c22e6a606d74e31425facf9f5f4 (patch) | |
| tree | 00ace954ed8ffb89fb780b0dfeb22a31a01d0244 /src/pkg_remove.c | |
| parent | 7019724ab5c818e18fb5ee61b6b14487c47da3ec (diff) | |
can install/remove packages, doesn't segfault (?)
Diffstat (limited to 'src/pkg_remove.c')
| -rw-r--r-- | src/pkg_remove.c | 8 |
1 files changed, 5 insertions, 3 deletions
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)); } |
