Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-21 08:59:59 -0500
committerDan McGee <dan@archlinux.org>2011-03-21 08:59:59 -0500
commit110eb314f0d8b4d28b9ff68ddd5bb5b07a1f8407 (patch)
tree2a07d3d67d5baa9db6f4b4eaa2f43822a0bea559 /lib
parent834ba4da932f9e196e06baf724e0bd379092ded5 (diff)
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 <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/sync.c6
1 files changed, 5 insertions, 1 deletions
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));
+ }
}
}