Blame SOURCES/0001-Not-considered-excluded-packages-as-a-best-candidate.patch

519a7b
From 5ab0d7ab942d97cb6992c8b73b29b2a896e9fe7a Mon Sep 17 00:00:00 2001
519a7b
From: Jaroslav Mracek <jmracek@redhat.com>
519a7b
Date: Fri, 22 Feb 2019 18:32:02 +0100
519a7b
Subject: [PATCH] Not considered excluded packages as a best candidate
519a7b
519a7b
---
519a7b
 src/policy.c | 28 ++++++++++++++++++++++++++++
519a7b
 1 file changed, 28 insertions(+)
519a7b
519a7b
diff --git a/src/policy.c b/src/policy.c
519a7b
index 5f61115..d51fa6f 100644
519a7b
--- a/src/policy.c
519a7b
+++ b/src/policy.c
519a7b
@@ -831,6 +831,33 @@ move_installed_to_front(Pool *pool, Queue *plist)
519a7b
     }
519a7b
 }
519a7b
 
519a7b
+
519a7b
+/*
519a7b
+ * prune_to_considered
519a7b
+ *
519a7b
+ * Keep only considered (pool->considered) solvables in plist. If pool->considered is NULL, it keeps
519a7b
+ * all solvable in plist. If non of solvables in plist is in considered map, it returns empty plist.
519a7b
+ */
519a7b
+static void
519a7b
+prune_to_considered(Pool *pool, Queue *plist)
519a7b
+{
519a7b
+  if (plist->count == 0)		/* no need to prune if plist is empty */
519a7b
+    return;
519a7b
+  if (!pool->considered)        /* no need to prune if no considered map */
519a7b
+    return;
519a7b
+  int i, j;
519a7b
+  Id id;
519a7b
+  for (i = j = 0; i < plist->count; i++)
519a7b
+    {
519a7b
+      id = plist->elements[i];
519a7b
+      if (MAPTST(pool->considered, id))
519a7b
+        {
519a7b
+          plist->elements[j++] = id;
519a7b
+        }
519a7b
+    }
519a7b
+  plist->count = j;
519a7b
+}
519a7b
+
519a7b
 /*
519a7b
  * prune_to_best_version
519a7b
  *
519a7b
@@ -1299,6 +1326,7 @@ policy_filter_unwanted(Solver *solv, Queue *plist, int mode)
519a7b
 	  return;
519a7b
 	}
519a7b
     }
519a7b
+  prune_to_considered(pool, plist);
519a7b
   if (plist->count > 1)
519a7b
     {
519a7b
       if (mode != POLICY_MODE_SUGGEST)
519a7b
--
519a7b
libgit2 0.27.7
519a7b