From 110eb314f0d8b4d28b9ff68ddd5bb5b07a1f8407 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 21 Mar 2011 08:59:59 -0500 Subject: Ensure package removal list does not contain duplicates Noticed with the openoffice/libreoffice replacement scheme where many packages are listed as replacements to one package, thus electing it for removal multiple times. Ensure a given package is not already present before placing it in the removal list. Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 29197807..d420cefb 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -512,7 +512,11 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync for(i = trans->add; i; i = i->next) { pmpkg_t *spkg = i->data; for(j = spkg->removes; j; j = j->next) { - trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(j->data)); + pmpkg_t *rpkg = j->data; + if(!_alpm_pkg_find(trans->remove, rpkg->name)) { + _alpm_log(PM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); + trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg)); + } } } -- cgit v1.2.3-24-g4f1b