solver: prefer highest requirer count above installed status
This ensures a swap is emitted when replacing a virtual with apk add.cute-signatures
parent
6aabb96c20
commit
20ae27c1da
10
src/solver.c
10
src/solver.c
|
@ -567,6 +567,11 @@ static int compare_providers(struct apk_solver_state *ss,
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
/* Prefer highest requirer count. */
|
||||||
|
r = count_requirers(pkgA) - count_requirers(pkgB);
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
|
|
||||||
/* Prefer installed */
|
/* Prefer installed */
|
||||||
if (!(solver_flags & APK_SOLVERF_UPGRADE)) {
|
if (!(solver_flags & APK_SOLVERF_UPGRADE)) {
|
||||||
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
|
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
|
||||||
|
@ -598,11 +603,6 @@ static int compare_providers(struct apk_solver_state *ss,
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
/* Prefer highest requirer count. */
|
|
||||||
r = count_requirers(pkgA) - count_requirers(pkgB);
|
|
||||||
if (r)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
/* Prefer highest declared provider priority. */
|
/* Prefer highest declared provider priority. */
|
||||||
r = pkgA->provider_priority - pkgB->provider_priority;
|
r = pkgA->provider_priority - pkgB->provider_priority;
|
||||||
if (r)
|
if (r)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
|
C:Q1eVpkasfqZAukAXFYbgwt4xAEEEe=
|
||||||
P:mailreadplus
|
P:mailreadplus
|
||||||
V:1
|
V:1
|
||||||
S:1
|
S:1
|
||||||
I:1
|
I:1
|
||||||
|
p:mail-reader
|
||||||
|
k:2
|
||||||
|
|
Loading…
Reference in New Issue