summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/solver.c10
-rw-r--r--test/provides-swap.installed5
2 files changed, 8 insertions, 7 deletions
diff --git a/src/solver.c b/src/solver.c
index 5d73af6..5698215 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -567,6 +567,11 @@ static int compare_providers(struct apk_solver_state *ss,
if (r)
return r;
+ /* Prefer highest requirer count. */
+ r = count_requirers(pkgA) - count_requirers(pkgB);
+ if (r)
+ return r;
+
/* Prefer installed */
if (!(solver_flags & APK_SOLVERF_UPGRADE)) {
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
@@ -598,11 +603,6 @@ static int compare_providers(struct apk_solver_state *ss,
if (r)
return r;
- /* Prefer highest requirer count. */
- r = count_requirers(pkgA) - count_requirers(pkgB);
- if (r)
- return r;
-
/* Prefer highest declared provider priority. */
r = pkgA->provider_priority - pkgB->provider_priority;
if (r)
diff --git a/test/provides-swap.installed b/test/provides-swap.installed
index 480def8..259783d 100644
--- a/test/provides-swap.installed
+++ b/test/provides-swap.installed
@@ -1,6 +1,7 @@
-C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
+C:Q1eVpkasfqZAukAXFYbgwt4xAEEEe=
P:mailreadplus
V:1
S:1
I:1
-
+p:mail-reader
+k:2