From: Michael Schroeder Date: Thu, 18 Apr 2019 13:44:38 +0000 (+0200) Subject: Move move_installed_to_front call after sort_by_common_dep X-Git-Tag: 0.7.5~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92372d57958b212bdce841f7749b1d6f2c2e341d;p=thirdparty%2Flibsolv.git Move move_installed_to_front call after sort_by_common_dep Staying with the already installed package name is more important than a common dependency. --- diff --git a/src/policy.c b/src/policy.c index ccaea5a2..823a0087 100644 --- a/src/policy.c +++ b/src/policy.c @@ -798,6 +798,8 @@ move_installed_to_front(Pool *pool, Queue *plist) Solvable *s; Id p, pp; + if (!pool->installed) + return; for (i = j = 0; i < plist->count; i++) { s = pool->solvables + plist->elements[i]; @@ -917,8 +919,6 @@ prune_to_best_version(Pool *pool, Queue *plist) else prune_obsoleted(pool, plist); } - if (plist->count > 1 && pool->installed) - move_installed_to_front(pool, plist); } @@ -1345,6 +1345,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode) #endif dislike_old_versions(pool, plist); sort_by_common_dep(pool, plist); + move_installed_to_front(pool, plist); if (solv->urpmreorder) urpm_reorder(solv, plist); prefer_suggested(solv, plist); @@ -1366,6 +1367,7 @@ pool_best_solvables(Pool *pool, Queue *plist, int flags) { dislike_old_versions(pool, plist); sort_by_common_dep(pool, plist); + move_installed_to_front(pool, plist); } }