From aef1c88f3bbfb2ec14c3cdc3914686f121e4d7d5 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 1 Sep 2007 14:12:39 +0200 Subject: libalpm/remove.c : avoid duplicated packages in removal list. Suppose a package foo depends on foo1, foo2, ..., foon. Doing pacman -Rc foo1 foo2 ... foon added foo n times to the removal list, because what checkdeps return is something like : foo1 is requiredby foo foo2 is requiredby foo ... foon is requiredby foo Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/remove.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 39cfe5a7..010e7ab6 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -113,9 +113,11 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) pmdepmissing_t *miss = (pmdepmissing_t *)i->data; pmpkg_t *info = _alpm_db_scan(db, miss->target); if(info) { - _alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list\n", - alpm_pkg_get_name(info)); - trans->packages = alpm_list_add(trans->packages, info); + if(!_alpm_pkg_find(alpm_pkg_get_name(info), trans->packages)) { + _alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list\n", + alpm_pkg_get_name(info)); + trans->packages = alpm_list_add(trans->packages, info); + } } else { _alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping\n"), miss->depend.name); -- cgit v1.2.3