From: Michael Matz Date: Tue, 12 Feb 2008 10:17:08 +0000 (+0000) Subject: Introduce pool->considered. A map to select a subset of solvables for X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~632 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f93fa50614c5904242ecbec7f6b72cda0f9d409d;p=thirdparty%2Flibsolv.git 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. --- diff --git a/src/pool.h b/src/pool.h index 352ceea4..6b344733 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 24ed84d2..d678557d 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); } -