From 1098ec077d2954f5171df490c44c2b833278c263 Mon Sep 17 00:00:00 2001 From: Matthew Sexton Date: Fri, 23 Jun 2023 16:02:06 -0400 Subject: [PATCH] HoldPkg in target list causes transaction to fail Signed-off-by: Matthew Sexton --- src/pacman/remove.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 98f8bcda..faf2f00d 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -131,19 +131,16 @@ int pacman_remove(alpm_list_t *targets) } /* Search for holdpkg in target list */ - int holdpkg = 0; for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) { alpm_pkg_t *pkg = i->data; if(alpm_list_find(config->holdpkg, alpm_pkg_get_name(pkg), fnmatch_cmp)) { - pm_printf(ALPM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"), + pm_printf(ALPM_LOG_ERROR, _("%s is designated as a HoldPkg, cannot complete transaction\n"), alpm_pkg_get_name(pkg)); - holdpkg = 1; + colon_printf(_("remove %s from HoldPkg to allow removal of the held package\n"), + alpm_pkg_get_name(pkg)); + return 1; } } - if(holdpkg && (noyes(_("HoldPkg was found in target list. Do you want to continue?")) == 0)) { - retval = 1; - goto cleanup; - } /* Step 3: actually perform the removal */ alpm_list_t *pkglist = alpm_trans_get_remove(config->handle);