diff options
author | Chantry Xavier <shiningxc@gmail.com> | 2007-07-12 13:49:23 +0200 |
---|---|---|
committer | Chantry Xavier <shiningxc@gmail.com> | 2007-07-13 15:47:20 +0200 |
commit | 723478560179bc541e89627c43b1cea512fab2a1 (patch) | |
tree | 782c117e880dd86d23884500e88e89ec3fec8344 | |
parent | c0a7d9d82d03d9831f53dbb30357ddb9f10e29ec (diff) | |
download | pacman-723478560179bc541e89627c43b1cea512fab2a1.tar.xz |
libalpm/remove.c : Rsd combination.
Currently the d (nodeps) option skips the s (recursive) part,
rendering the Rsd combination totally useless.
This patch makes a recursive removal still possible using the nodeps option,
as Romashka asked there :
http://bugs.archlinux.org/task/6057#comment17784
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
-rw-r--r-- | lib/libalpm/remove.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 31982ea0..5315d96c 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -96,9 +96,13 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); - if(!(trans->flags & (PM_TRANS_FLAG_NODEPS)) && (trans->type != PM_TRANS_TYPE_UPGRADE)) { - EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); + if(trans->type == PM_TRANS_TYPE_UPGRADE) { + return(0); + } + EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); + + if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { _alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies"); lp = _alpm_checkdeps(db, trans->type, trans->packages); if(lp != NULL) { @@ -129,21 +133,21 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1); } } + } - if(trans->flags & PM_TRANS_FLAG_RECURSE) { - _alpm_log(PM_LOG_DEBUG, "finding removable dependencies"); - trans->packages = _alpm_removedeps(db, trans->packages); - } + if(trans->flags & PM_TRANS_FLAG_RECURSE) { + _alpm_log(PM_LOG_DEBUG, "finding removable dependencies"); + trans->packages = _alpm_removedeps(db, trans->packages); + } - /* re-order w.r.t. dependencies */ - _alpm_log(PM_LOG_DEBUG, "sorting by dependencies"); - lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE); - /* free the old alltargs */ - alpm_list_free(trans->packages); - trans->packages = lp; + /* re-order w.r.t. dependencies */ + _alpm_log(PM_LOG_DEBUG, "sorting by dependencies"); + lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE); + /* free the old alltargs */ + alpm_list_free(trans->packages); + trans->packages = lp; - EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); - } + EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); return(0); } |