summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-12-20 21:58:41 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-12-20 22:41:14 +0200
commitd04cc33f6feb17ede16086080be1ec228a8d0390 (patch)
tree0439394f29640e1a26e57b5d7e7cb89854312543
parent0726606de2db6a0e75bc4ebe1a010122d0367f0f (diff)
downloadapk-tools-d04cc33f6feb17ede16086080be1ec228a8d0390.tar.gz
apk-tools-d04cc33f6feb17ede16086080be1ec228a8d0390.tar.bz2
apk-tools-d04cc33f6feb17ede16086080be1ec228a8d0390.tar.xz
apk-tools-d04cc33f6feb17ede16086080be1ec228a8d0390.zip
solver: fix queue resolving order
It makes sense to not prioritize requirers anymore. It was originally intended to select early packages with multiple constraints seen. However, more important are the constraints that actually limit the choise. fixes #10843
-rw-r--r--src/solver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/solver.c b/src/solver.c
index 3a8f6e6..2a15d7e 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -1022,13 +1022,13 @@ static int compare_name_dequeue(const struct apk_name *a, const struct apk_name
{
int r;
- r = (!!a->ss.requirers) - (!!b->ss.requirers);
- if (r) return -r;
-
r = (int)a->priority - (int)b->priority;
if (r) return r;
r = a->ss.max_dep_chain - b->ss.max_dep_chain;
+ if (r) return -r;
+
+ r = (!!a->ss.requirers) - (!!b->ss.requirers);
return -r;
}