Author: kkaempf Date: Thu Feb 7 10:59:09 2008 New Revision: 8523 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8523&view=rev Log: prepare limittokind Modified: trunk/sat-solver/src/solver.c trunk/sat-solver/src/solver.h Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=8523&r1=8522&r2=8523&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Thu Feb 7 10:59:09 2008 @@ -2116,6 +2116,16 @@ solv->rules = sat_extend_resize(solv->rules, solv->nrules, sizeof(Rule), RULES_BLOCK); memset(solv->rules, 0, sizeof(Rule)); + /* cannot be zero by default since zero corresponds to KIND_PACKAGE + * so we initialize it with _KIND_MAX to denote 'all kinds' + * if the application sets this to a specific KIND_, the value is + * incremented by 1 at solver start to make 'if (limittokind)' checks easy + * + * A sure candidate for a more clever implementation + */ + + solv->limittokind = _KIND_MAX; + return solv; } @@ -2563,7 +2573,7 @@ queue_empty(refined); queue_push(refined, sug); - /* re-enable all problem rules with the exception of "sug" */ + /* re-enable all problem rules with the exception of "sug"(gests) */ revert(solv, 1); reset_solver(solv); @@ -3471,6 +3481,11 @@ Queue q; Solvable *s; + if (solv->limittokind != _KIND_MAX) /* if application wants to limit, make it non-zero */ + solv->limittokind += 1; + else + solv->limittokind = 0; + /* create whatprovides if not already there */ if (!pool->whatprovides) pool_createwhatprovides(pool); Modified: trunk/sat-solver/src/solver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=8523&r1=8522&r2=8523&view=diff ============================================================================== --- trunk/sat-solver/src/solver.h (original) +++ trunk/sat-solver/src/solver.h Thu Feb 7 10:59:09 2008 @@ -121,7 +121,8 @@ int allowvirtualconflicts; /* false: conflicts on package name, true: conflicts on package provides */ int noupdateprovide; /* true: update packages needs not to provide old package */ int dosplitprovides; /* true: consider legacy split provides */ - + solvable_kind limittokind; + /* Callbacks for defining the bahaviour of the SAT solver */ /* Finding best candidate -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org