From 92372d57958b212bdce841f7749b1d6f2c2e341d Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 18 Apr 2019 15:44:38 +0200 Subject: [PATCH] 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. --- src/policy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } -- 2.47.2