From a86c8ed0828f670b875b418ef10d83bddeca97f6 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Mon, 12 Nov 2018 13:20:14 +0200 Subject: fix package preference based on it's conflicts in --latest mode remove also redundant pkg_selectable check in repair mode. --- src/solver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/solver.c b/src/solver.c index 7abc80c..5522707 100644 --- a/src/solver.c +++ b/src/solver.c @@ -566,10 +566,6 @@ static int compare_providers(struct apk_solver_state *ss, r = (int)pkgA->ss.pkg_available - (int)pkgB->ss.pkg_available; if (r) return r; - } else if (solver_flags & APK_SOLVERF_REINSTALL) { - r = (int)pkgA->ss.pkg_selectable - (int)pkgB->ss.pkg_selectable; - if (r) - return r; } /* Prefer preferred pinning */ @@ -618,6 +614,11 @@ static int compare_providers(struct apk_solver_state *ss, if (r) return r; + /* Prefer without errors (mostly if --latest used, and different provider) */ + r = (int)pkgA->ss.pkg_selectable - (int)pkgB->ss.pkg_selectable; + if (r) + return r; + /* Prefer lowest available repository */ return ffs(pkgB->repos) - ffs(pkgA->repos); } -- cgit v1.2.3-70-g09d2