1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00

conflict.c: start cleaning conflict check functions

The three chk_ functions overlap for packages both in targets and in the
database. This caused the same conflict to be found in both direction
(A conflicts with B, and B conflicts with A).

This patch avoids this duplication. which shouldn't be needed, but other
changes might be required for that to work correctly.

This also has the unexpected side effect to hide the failure of sync022
pactest, for FS #7415. That's maybe not a good thing though..

Note from Dan: sync022 does succeed, but a sync023 pactest added to check
regressions also seems to pass. This may be a valid fix to this 'problem'
sync022 was meant to find.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2007-06-21 12:46:37 +02:00 committed by Dan McGee
parent 37736a56f9
commit cb164c3130

View File

@ -192,28 +192,18 @@ static alpm_list_t *chk_db_vs_targets(alpm_list_t *baddeps, pmpkg_t *pkg,
continue; continue;
} }
/* is this db package in the targets? if so use the if(_alpm_pkg_find(dbpkgname, targets)) {
* new package's conflict list to pick up new changes */ /* skip targets, already handled by chk_pkg_vs_targets in checkconflicts */
int use_newconflicts = 0; _alpm_log(PM_LOG_DEBUG, "target '%s' is also in target list, ignoring it",
for(j = targets; j; j = j->next) { dbpkgname);
pmpkg_t *targ = j->data; continue;
if(strcmp(alpm_pkg_get_name(targ), dbpkgname) == 0) {
_alpm_log(PM_LOG_DEBUG, "target '%s' is also in target list, using NEW conflicts",
dbpkgname);
conflicts = alpm_pkg_get_conflicts(targ);
use_newconflicts = 1;
break;
}
}
/* if we didn't find newer conflicts, use the original list */
if(!use_newconflicts) {
conflicts = alpm_pkg_get_conflicts(dbpkg);
} }
conflicts = alpm_pkg_get_conflicts(dbpkg);
for(j = conflicts; j; j = j->next) { for(j = conflicts; j; j = j->next) {
const char *conflict = j->data; const char *conflict = j->data;
miss = does_conflict(pkgname, dbpkgname, pkg, conflict); miss = does_conflict(pkgname, dbpkgname, pkg, conflict);
if(miss && !_alpm_depmiss_isin(miss, baddeps)) { if(miss && !_alpm_depmiss_isin(miss, baddeps)) {
baddeps = alpm_list_add(baddeps, miss); baddeps = alpm_list_add(baddeps, miss);