Commit e7fd4d03 authored by Timo Teräs's avatar Timo Teräs

solver: rewrite as deductive solver -- pinning support

Fix also pinning test cases to be more sane.
parent 426a1268
......@@ -21,8 +21,6 @@ struct apk_solver_name_state {
struct list_head unresolved_list;
struct apk_provider chosen;
unsigned int preferred_pinning;
unsigned short requirers;
unsigned short merge_index;
unsigned short max_dep_chain;
......@@ -39,9 +37,13 @@ struct apk_solver_name_state {
struct apk_solver_package_state {
unsigned int conflicts;
unsigned short max_dep_chain;
unsigned short pinning_allowed;
unsigned short pinning_preferred;
unsigned solver_flags : 4;
unsigned solver_flags_inheritable : 4;
unsigned seen : 1;
unsigned tag_ok : 1;
unsigned tag_preferred : 1;
unsigned available : 1;
unsigned in_changeset : 1;
unsigned iif_triggered : 1;
......
......@@ -398,7 +398,7 @@ static void print_pinning_errors(struct apk_database *db, char *label,
if (pkg->repos & apk_db_get_pinning_mask_repos(db, APK_DEFAULT_PINNING_MASK | BIT(tag)))
return;
printf(" %s: but needs pinning:", label);
printf(" %s: not pinned:", label);
for (i = 0; i < db->num_repo_tags; i++) {
if (pkg->repos & db->repo_tags[i].allowed_repos)
printf(" @" BLOB_FMT, BLOB_PRINTF(*db->repo_tags[i].name));
......
This diff is collapsed.
C:Q1eVpkasfqZAukAdFYbgwt4xffZWU=
P:a
V:2
S:1
I:1
D:b
C:Q1hdUpffv5mYgJEqW52UmVsv23ysE=
P:b
V:2
S:1
I:1
C:Q1eVpkasfqZAukArrYbg324xAt4WU=
P:c
V:2
S:1
I:1
D:a>=2
C:Q1eVpkasfqZAukAffYsd324xAtxxU=
P:iif
V:3
S:1
I:1
D:a b
i:a
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
add a
@EXPECT
(1/2) Installing b (2)
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-instdb pinning.installed
--test-world "a@testing"
add a
......
@ARGS
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-world "a@testing"
add c>=3
@EXPECT
ERROR: unsatisfiable dependencies:
c-3: not pinned: @testing
@ARGS
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-repo testing:pinning-overlay3.repo
add a@testing
@EXPECT
(1/3) Installing b (2)
(2/3) Installing a@testing (3)
(3/3) Installing iif@testing (3)
OK: 0 MiB in 0 packages
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
add a@testing
@EXPECT
(1/2) Installing b (2)
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
add a@testing b@testing
@EXPECT
(1/2) Installing b@testing (3)
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
add c@testing
@EXPECT
(1/3) Installing b (2)
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo testing:pinning.repo2
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-repo testing:pinning-overlay2.repo
--test-instdb pinning.installed
--test-world "c@testing"
add
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo testing:pinning.repo2
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-repo testing:pinning-overlay2.repo
--test-instdb pinning.installed
--test-world "c@testing"
upgrade
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo
--test-repo testing2:pinning.repo
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-repo testing2:pinning-overlay1.repo
--test-instdb pinning.installed
--test-world "c@testing"
add c@testing2
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo2
--test-instdb pinning.installed2
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay2.repo
--test-instdb pinning.installed
--test-world "c@testing"
upgrade -a
@EXPECT
......
@ARGS
--test-repo basic.repo
--test-repo testing:pinning.repo2
--test-repo pinning-basic.repo
--test-repo testing:pinning-overlay1.repo
--test-instdb pinning.installed2
--test-world "c@testing"
add
......
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