index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aurelien Foret <aurelien@archlinux.org> | 2005-03-25 22:09:14 +0000 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-03-25 22:09:14 +0000 |
commit | 7c847fd7d4fee0fa5e0314f409eb06cfda2c289b (patch) | |
tree | 0e9d02aaf7284066f506fef81a758276ba466b56 /lib/libalpm/remove.c | |
parent | 6e63ccfd0fdd19b6d710eb8dc84c85aaf25c3006 (diff) |
-rw-r--r-- | lib/libalpm/remove.c | 12 |
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 619dd913..e361fc70 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -65,7 +65,7 @@ int remove_loadtarget(pmdb_t *db, pmtrans_t *trans, char *name) int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) { pmpkg_t *info; - PMList *lp; + PMList *lp, *i; ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); @@ -99,6 +99,16 @@ int remove_prepare(pmdb_t *db, pmtrans_t *trans, PMList **data) trans->packages = removedeps(db, trans->packages); } + /* re-order w.r.t. dependencies */ + _alpm_log(PM_LOG_FLOW2, "sorting by dependencies..."); + lp = sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE); + /* free the old alltargs */ + for(i = trans->packages; i; i = i->next) { + i->data = NULL; + } + FREELIST(trans->packages); + trans->packages = lp; + TRANS_CB(trans, PM_TRANS_EVT_DEPS_DONE, NULL, NULL); } |