From f93fa50614c5904242ecbec7f6b72cda0f9d409d Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 12 Feb 2008 10:17:08 +0000 Subject: [PATCH] Introduce pool->considered. A map to select a subset of solvables for solving. As with whatprovides this currently lives in the pool and somewhen should probably be moved with it into Solver. --- src/pool.h | 11 +++++++++++ src/solver.c | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pool.h b/src/pool.h index 352ceea..6b34473 100644 --- a/src/pool.h +++ b/src/pool.h @@ -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; } diff --git a/src/solver.c b/src/solver.c index 24ed84d..d678557 100644 --- a/src/solver.c +++ b/src/solver.c @@ -3832,4 +3832,3 @@ solver_solve(Solver *solv, Queue *job) if (solv->problems.count) problems_to_solutions(solv, job); } - -- 2.7.4