Commit 179b453a authored by Timo Teräs's avatar Timo Teräs

solver: fix conflicting provides detection

ref #574
parent 536c2197
......@@ -788,7 +788,6 @@ static inline void unassign_name(struct apk_solver_state *ss, struct apk_name *n
}
}
static solver_result_t apply_decision(struct apk_solver_state *ss,
struct apk_decision *d)
{
......@@ -894,6 +893,9 @@ static void undo_decision(struct apk_solver_state *ss,
ss->topology_position = pkg->topology_hard;
}
for (i = 0; i < pkg->provides->num; i++)
name_to_ns(pkg->provides->item[i].name)->name_touched = 1;
if (ns->locked) {
foreach_rinstall_if_pkg(ss, pkg, untrigger_install_if);
foreach_dependency(ss, pkg->depends, undo_constraint);
......@@ -1140,7 +1142,7 @@ static int reconsider_name(struct apk_solver_state *ss, struct apk_name *name)
struct apk_name_state *ns = name_to_ns(name);
struct apk_provider *next_p = NULL;
unsigned int next_topology = 0, options = 0;
int i, score_locked = FALSE;
int i, j, score_locked = FALSE;
if (!ns->none_excluded) {
struct apk_score minscore;
......@@ -1166,6 +1168,17 @@ static int reconsider_name(struct apk_solver_state *ss, struct apk_name *name)
((pkg0->ipkg == NULL && !pkg_available(ss->db, pkg0))))
continue;
for (j = 0; j < pkg0->provides->num; j++) {
struct apk_dependency *p00 = &pkg0->provides->item[j];
if (!name_to_ns(p00->name)->locked)
continue;
if (name_to_ns(p00->name)->chosen.version != &apk_null_blob ||
p00->version != &apk_null_blob)
break;
}
if (j < pkg0->provides->num)
continue;
score_locked = get_topology_score(ss, ns, pkg0, &pkg0_score);
/* viable alternative? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment