Introduce pool->considered. A map to select a subset of solvables for
authorMichael Matz <matz@suse.de>
Tue, 12 Feb 2008 10:17:08 +0000 (10:17 +0000)
committerMichael Matz <matz@suse.de>
Tue, 12 Feb 2008 10:17:08 +0000 (10:17 +0000)
solving.  As with whatprovides this currently lives in the pool and
somewhen should probably be moved with it into Solver.

src/pool.h
src/solver.c

index 352ceea..6b34473 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
 #include "pooltypes.h"
 #include "poolid.h"
 #include "solvable.h"
+#include "bitmap.h"
 #include "queue.h"
 #include "strpool.h"
 
@@ -104,6 +105,10 @@ struct _Pool {
   Offset whatprovidesdataoff;  /* next free slot within whatprovidesdata */
   int whatprovidesdataleft;    /* number of 'free slots' within whatprovidesdata */
 
+  /* If nonzero, then consider only the solvables with Ids set in this
+     bitmap for solving.  If zero, consider all solvables.  */
+  Map *considered;
+
   Id (*nscallback)(struct _Pool *, void *data, Id name, Id evr);
   void *nscallbackdata;
 
@@ -231,6 +236,12 @@ static inline int pool_installable(Pool *pool, Solvable *s)
     return 0;
   if (pool->id2arch && (s->arch > pool->lastarch || !pool->id2arch[s->arch]))
     return 0;
+  if (pool->considered)
+    { 
+      Id id = s - pool->solvables;
+      if (!MAPTST(pool->considered, id))
+       return 0;
+    }
   return 1;
 }
 
index 24ed84d..d678557 100644 (file)
@@ -3832,4 +3832,3 @@ solver_solve(Solver *solv, Queue *job)
   if (solv->problems.count)
     problems_to_solutions(solv, job);
 }
-