From d1ea16dfd0d497aff72d7a315890971e7f070786 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Tue, 11 Mar 2008 16:40:27 +0100 Subject: Avoid duplicated target names. This patch should avoid duplicated target names in the backend. 1. sync_loadtarget will return with PM_ERR_TRANS_DUP_TARGET when trying to add a duplicated target 2. sysupgrade never pulls duplicated targets 3. resolvedeps won't pull duplicated targets anymore A pulled list was introduced in sync_prepare to improve the pmsyncpkg_t<->pmpkg_t list conversion by making it more direct. Also replace sync1005 and sync1006 by the sync1008 pactest, which is similar but more interesting (the provisions are dependencies instead of explicit targets). sync1005 didn't work as expected anyway. It was expecting that pacman failed, and pacman indeed failed, but not for the good reason. It didn't fail during the preparation step because of conflicting targets, but during the commit step, because of a md5 error... And sync1006 didn't pass and was not really worth fixing. We have already enough failing pactests more important than these two. sync1008 pass with this patch. Signed-off-by: Nagy Gabor Signed-off-by: Chantry Xavier --- lib/libalpm/deps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 180c46bf..1eebca3e 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -570,7 +570,8 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, if(!sync) { continue; } - found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove); + found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove) + && !_alpm_pkg_find(alpm_pkg_get_name(sync), *list); if(!found) { continue; } @@ -592,7 +593,8 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, continue; } found = alpm_depcmp(sync, missdep) && strcmp(sync->name, missdep->name) - && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove); + && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove) + && !_alpm_pkg_find(alpm_pkg_get_name(sync), *list); if(!found) { continue; } -- cgit v1.2.3-24-g4f1b