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;
}
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);
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);
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