Further fixes to replacement iteration

A partial fix for this was in commit 7de92cb22, but this should fix the
remaining cases. There are still several issues dealing with "provision
as replacement" selection however.

Addresses FS#25538 and FS#25527.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-08-15 14:44:38 -05:00
parent 88bd1cec77
commit 796eaaed40

View file

@ -145,9 +145,9 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
break; break;
} else { } else {
/* 2. search for replacers in sdb */ /* 2. search for replacers in sdb */
int found = 0;
alpm_list_t *k, *l; alpm_list_t *k, *l;
for(k = _alpm_db_get_pkgcache(sdb); k; k = k->next) { for(k = _alpm_db_get_pkgcache(sdb); k; k = k->next) {
int found = 0;
spkg = k->data; spkg = k->data;
for(l = alpm_pkg_get_replaces(spkg); l; l = l->next) { for(l = alpm_pkg_get_replaces(spkg); l; l = l->next) {
alpm_depend_t *replace = l->data; alpm_depend_t *replace = l->data;
@ -160,16 +160,15 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
/* check IgnorePkg/IgnoreGroup */ /* check IgnorePkg/IgnoreGroup */
if(_alpm_pkg_should_ignore(handle, spkg) if(_alpm_pkg_should_ignore(handle, spkg)
|| _alpm_pkg_should_ignore(handle, lpkg)) { || _alpm_pkg_should_ignore(handle, lpkg)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package replacement (%s-%s => %s-%s)\n"), _alpm_log(handle, ALPM_LOG_WARNING,
_("ignoring package replacement (%s-%s => %s-%s)\n"),
lpkg->name, lpkg->version, spkg->name, spkg->version); lpkg->name, lpkg->version, spkg->name, spkg->version);
found = 0;
continue; continue;
} }
int doreplace = 0; int doreplace = 0;
QUESTION(trans, ALPM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, sdb->treename, &doreplace); QUESTION(trans, ALPM_TRANS_CONV_REPLACE_PKG, lpkg, spkg, sdb->treename, &doreplace);
if(!doreplace) { if(!doreplace) {
found = 0;
continue; continue;
} }
@ -181,7 +180,6 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
if(tpkg->origin_data.db != sdb) { if(tpkg->origin_data.db != sdb) {
_alpm_log(handle, ALPM_LOG_WARNING, _("cannot replace %s by %s\n"), _alpm_log(handle, ALPM_LOG_WARNING, _("cannot replace %s by %s\n"),
lpkg->name, spkg->name); lpkg->name, spkg->name);
found = 0;
continue; continue;
} }
_alpm_log(handle, ALPM_LOG_DEBUG, "appending %s to the removes list of %s\n", _alpm_log(handle, ALPM_LOG_DEBUG, "appending %s to the removes list of %s\n",
@ -202,10 +200,6 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
} }
} }
} }
if(found) {
/* jump to next local package */
break;
}
} }
} }
} }