]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Move move_installed_to_front call after sort_by_common_dep
authorMichael Schroeder <mls@suse.de>
Thu, 18 Apr 2019 13:44:38 +0000 (15:44 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 18 Apr 2019 13:44:38 +0000 (15:44 +0200)
Staying with the already installed package name is more important
than a common dependency.

src/policy.c

index ccaea5a2e7a043492b0040d1cb47995ea6a58095..823a00878e9c7534da3a503b6e88eef48a086432 100644 (file)
@@ -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);
     }
 }