summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorChantry Xavier <shiningxc@gmail.com>2007-09-01 14:12:39 +0200
committerDan McGee <dan@archlinux.org>2007-09-02 09:33:46 -0500
commitaef1c88f3bbfb2ec14c3cdc3914686f121e4d7d5 (patch)
tree7f58e84a1d0c99667ee88d4ecbaf4aaef3be3f10 /lib/libalpm
parent788fcee0dc191e19c116671cea5d92ab321e2615 (diff)
downloadpacman-aef1c88f3bbfb2ec14c3cdc3914686f121e4d7d5.tar.xz
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 <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/remove.c8
1 files changed, 5 insertions, 3 deletions
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);