From 3c94ec4de27908b9406255dfd9d1f38abcafd8fa Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 24 Aug 2008 19:25:31 +0200 Subject: [PATCH] Extend HoldPkg to -Rc and -Rs. The HoldPkg feature is even more important when the packages to be held are pulled automatically be pacman, in a -Rc and -Rs operation. Before, it only applied when the packages were explicitly requested by the user to be removed. Signed-off-by: Xavier Chantry --- lib/libalpm/remove.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 864fafa..bb0f0b5 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -65,16 +65,6 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) RET_ERR(PM_ERR_PKG_NOT_FOUND, -1); } - /* ignore holdpkgs on upgrade */ - if((trans == handle->trans) - && alpm_list_find_str(handle->holdpkg, info->name)) { - int resp = 0; - QUESTION(trans, PM_TRANS_CONV_REMOVE_HOLDPKG, info, NULL, NULL, &resp); - if(!resp) { - RET_ERR(PM_ERR_PKG_HOLD, -1); - } - } - _alpm_log(PM_LOG_DEBUG, "adding %s in the targets list\n", info->name); trans->packages = alpm_list_add(trans->packages, _alpm_pkg_dup(info)); @@ -199,6 +189,17 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); } + for(lp = trans->packages; lp; lp = lp->next) { + pmpkg_t *pkg = lp->data; + if(alpm_list_find_str(handle->holdpkg, pkg->name)) { + int resp = 0; + QUESTION(trans, PM_TRANS_CONV_REMOVE_HOLDPKG, pkg, NULL, NULL, &resp); + if(!resp) { + RET_ERR(PM_ERR_PKG_HOLD, -1); + } + } + } + return(0); } -- 1.6.0