Imported Upstream version 0.6.29
[platform/upstream/libsolv.git] / src / policy.c
index 8b4c2e4..468be67 100644 (file)
@@ -202,14 +202,14 @@ solver_prune_to_highest_prio_per_name(Solver *solv, Queue *plist)
     {
       if (pool->solvables[plist->elements[i]].name != name)
        {
+         name = pool->solvables[plist->elements[i]].name;
          if (pq.count > 2)
            solver_prune_to_highest_prio(solv, &pq);
          for (k = 0; k < pq.count; k++)
            plist->elements[j++] = pq.elements[k];
          queue_empty(&pq);
-         queue_push(&pq, plist->elements[i]);
-         name = pool->solvables[pq.elements[0]].name;
        }
+      queue_push(&pq, plist->elements[i]);
     }
   if (pq.count > 2)
     solver_prune_to_highest_prio(solv, &pq);
@@ -1353,6 +1353,22 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode)
     }
 }
 
+void
+pool_best_solvables(Pool *pool, Queue *plist, int flags)
+{
+  if (plist->count > 1)
+    prune_to_highest_prio(pool, plist);
+  if (plist->count > 1)
+    prune_to_best_arch(pool, plist);
+  if (plist->count > 1)
+    prune_to_best_version(pool, plist);
+  if (plist->count > 1)
+    {
+      dislike_old_versions(pool, plist);
+      sort_by_common_dep(pool, plist);
+    }
+}
+
 
 /* check if there is an illegal architecture change if
  * installed solvable s1 is replaced by s2 */