fix package preference based on it's conflicts in --latest mode

remove also redundant pkg_selectable check in repair mode.
cute-signatures
Timo Teräs 2018-11-12 13:20:14 +02:00
parent 8fa193ecda
commit a86c8ed082
1 changed files with 5 additions and 4 deletions

View File

@ -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);
}