Commit 536c2197 authored by Timo Teräs's avatar Timo Teräs

solver: allow multiple packages with same virtual provides

ref #574
parent b7a22e55
......@@ -116,6 +116,7 @@ struct apk_name_state {
unsigned short requirers;
unsigned short install_ifs;
unsigned short preferred_pinning;
unsigned short locked;
/* one time prepare/finish flags */
unsigned solver_flags_local : 4;
......@@ -129,7 +130,6 @@ struct apk_name_state {
/* dynamic state flags */
unsigned none_excluded : 1;
unsigned locked : 1;
unsigned name_touched : 1;
};
......@@ -761,9 +761,14 @@ static inline void assign_name(
{
struct apk_name_state *ns = name_to_ns(name);
ASSERT(!ns->locked, "Assigning locked name");
ns->locked = 1;
if (p.version == &apk_null_blob) {
ASSERT(!ns->locked || ns->chosen.version == &apk_null_blob,
"Assigning locked name with version");
} else {
ASSERT(!ns->locked, "Assigning locked name");
}
ns->chosen = p;
ns->locked++;
if (list_hashed(&ns->unsolved_list)) {
list_del(&ns->unsolved_list);
list_init(&ns->unsolved_list);
......@@ -775,11 +780,12 @@ static inline void unassign_name(struct apk_solver_state *ss, struct apk_name *n
struct apk_name_state *ns = name_to_ns(name);
ASSERT(ns->locked, "Unassigning unlocked name");
ns->locked = 0;
ns->chosen = CHOSEN_NONE;
ns->name_touched = 1;
demote_name(ss, name);
ns->locked--;
if (ns->locked == 0) {
ns->chosen = CHOSEN_NONE;
ns->name_touched = 1;
demote_name(ss, name);
}
}
......
......@@ -31,14 +31,12 @@ P:server-a
V:1
S:1
I:1
p:theservice
D:!theservice
p:theservice=1
C:Q1eVpkasfqZAukAXFYbgwt444EEEe=
P:server-b
V:1
S:1
I:1
p:theservice
D:!theservice
p:theservice=2
......@@ -2,4 +2,6 @@
--test-repo provides.repo
add mymailreader mailreadplus
@EXPECT
(1/2) Installing mymailreader (1)
(2/2) Installing mailreadplus (1)
OK: 0 MiB in 0 packages
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