pool_set_languages;
pool_setarch;
pool_setarchpolicy;
+ pool_setdebugcallback;
pool_setdebuglevel;
+ pool_setdebugmask;
+ pool_setloadcallback;
pool_setvendorclasses;
pool_shrink_rels;
pool_shrink_strings;
repo_add_repodata;
repo_add_solv;
repo_add_solv_flags;
+ repo_add_solvable;
+ repo_add_solvable_block;
repo_addid;
repo_addid_dep;
repo_create;
repo_fix_supplements;
repo_free;
repo_freeallrepos;
+ repo_free_solvable;
repo_free_solvable_block;
repo_internalize;
repo_last_repodata;
mask |= SAT_DEBUG_PROPAGATE;
if (level > 3)
mask |= SAT_DEBUG_RULE_CREATION;
- if (level > 4)
- mask |= SAT_DEBUG_SCHUBI;
mask |= pool->debugmask & SAT_DEBUG_TO_STDERR; /* keep bit */
pool->debugmask = mask;
}
+void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata)
+{
+ pool->debugcallback = debugcallback;
+ pool->debugcallbackdata = debugcallbackdata;
+}
+
+void pool_setdebugmask(Pool *pool, int mask)
+{
+ pool->debugmask = mask;
+}
+
+void pool_setloadcallback(Pool *pool, int (*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata)
+{
+ pool->loadcallback = cb;
+ pool->loadcallbackdata = loadcbdata;
+}
+
/*************************************************************************/
struct searchfiles {
#define SAT_DEBUG_POLICY (1<<9)
#define SAT_DEBUG_RESULT (1<<10)
#define SAT_DEBUG_JOB (1<<11)
-#define SAT_DEBUG_SCHUBI (1<<12)
-#define SAT_DEBUG_SOLVER (1<<13)
-#define SAT_DEBUG_TRANSACTION (1<<14)
+#define SAT_DEBUG_SOLVER (1<<12)
+#define SAT_DEBUG_TRANSACTION (1<<13)
#define SAT_DEBUG_TO_STDERR (1<<30)
extern void pool_setvendorclasses(Pool *pool, const char **vendorclasses);
extern void pool_debug(Pool *pool, int type, const char *format, ...) __attribute__((format(printf, 3, 4)));
+extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata);
+extern void pool_setdebugmask(Pool *pool, int mask);
+extern void pool_setloadcallback(Pool *pool, int (*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata);
+
extern char *pool_alloctmpspace(Pool *pool, int len);
extern void pool_freetmpspace(Pool *pool, const char *space);
return pool->whatprovidesdata + off;
}
-static inline void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata)
-{
- pool->debugcallback = debugcallback;
- pool->debugcallbackdata = debugcallbackdata;
-}
-
-static inline void pool_setdebugmask(Pool *pool, int mask)
-{
- pool->debugmask = mask;
-}
-
-static inline void pool_setloadcallback(Pool *pool, int (*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata)
-{
- pool->loadcallback = cb;
- pool->loadcallbackdata = loadcbdata;
-}
-
/* search the pool. the following filters are available:
* p - search just this solvable
* key - search only this key
if (!solv->problems.count)
{
POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "no more problems!\n");
- IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
- solver_printdecisions(solv);
break; /* great, no more problems */
}
disabledcnt = disabled.count;
pool_free_solvable_block(pool, 2, pool->nsolvables - 2, reuseids);
}
+Id repo_add_solvable(Repo *repo)
+{
+ Id p = pool_add_solvable(repo->pool);
+ if (!repo->start || repo->start == repo->end)
+ repo->start = repo->end = p;
+ /* warning: sidedata must be extended before adapting start/end */
+ if (repo->rpmdbid)
+ repo->rpmdbid = (Id *)repo_sidedata_extend(repo, repo->rpmdbid, sizeof(Id), p, 1);
+ if (p < repo->start)
+ repo->start = p;
+ if (p + 1 > repo->end)
+ repo->end = p + 1;
+ repo->nsolvables++;
+ repo->pool->solvables[p].repo = repo;
+ return p;
+}
+
+Id repo_add_solvable_block(Repo *repo, int count)
+{
+ Id p;
+ Solvable *s;
+ if (!count)
+ return 0;
+ p = pool_add_solvable_block(repo->pool, count);
+ if (!repo->start || repo->start == repo->end)
+ repo->start = repo->end = p;
+ /* warning: sidedata must be extended before adapting start/end */
+ if (repo->rpmdbid)
+ repo->rpmdbid = (Id *)repo_sidedata_extend(repo, repo->rpmdbid, sizeof(Id), p, count);
+ if (p < repo->start)
+ repo->start = p;
+ if (p + count > repo->end)
+ repo->end = p + count;
+ repo->nsolvables += count;
+ for (s = repo->pool->solvables + p; count--; s++)
+ s->repo = repo;
+ return p;
+}
+
+void repo_free_solvable(Repo *repo, Id p, int reuseids)
+{
+ repo_free_solvable_block(repo, p, 1, reuseids);
+}
+
void repo_free_solvable_block(Repo *repo, Id start, int count, int reuseids)
{
Solvable *s;
extern void repo_free(Repo *repo, int reuseids);
extern void repo_empty(Repo *repo, int reuseids);
extern void repo_freeallrepos(Pool *pool, int reuseids);
+extern Id repo_add_solvable(Repo *repo);
+extern Id repo_add_solvable_block(Repo *repo, int count);
+extern void repo_free_solvable(Repo *repo, Id p, int reuseids);
extern void repo_free_solvable_block(Repo *repo, Id start, int count, int reuseids);
extern void *repo_sidedata_create(Repo *repo, size_t size);
extern void *repo_sidedata_extend(Repo *repo, void *b, size_t size, Id p, int count);
return repo->name;
}
-static inline Id repo_add_solvable(Repo *repo)
-{
- extern Id pool_add_solvable(Pool *pool);
- Id p = pool_add_solvable(repo->pool);
- if (!repo->start || repo->start == repo->end)
- repo->start = repo->end = p;
- /* warning: sidedata must be extended before adapting start/end */
- if (repo->rpmdbid)
- repo->rpmdbid = (Id *)repo_sidedata_extend(repo, repo->rpmdbid, sizeof(Id), p, 1);
- if (p < repo->start)
- repo->start = p;
- if (p + 1 > repo->end)
- repo->end = p + 1;
- repo->nsolvables++;
- repo->pool->solvables[p].repo = repo;
- return p;
-}
-
-static inline Id repo_add_solvable_block(Repo *repo, int count)
-{
- extern Id pool_add_solvable_block(Pool *pool, int count);
- Id p;
- Solvable *s;
- if (!count)
- return 0;
- p = pool_add_solvable_block(repo->pool, count);
- if (!repo->start || repo->start == repo->end)
- repo->start = repo->end = p;
- /* warning: sidedata must be extended before adapting start/end */
- if (repo->rpmdbid)
- repo->rpmdbid = (Id *)repo_sidedata_extend(repo, repo->rpmdbid, sizeof(Id), p, count);
- if (p < repo->start)
- repo->start = p;
- if (p + count > repo->end)
- repo->end = p + count;
- repo->nsolvables += count;
- for (s = repo->pool->solvables + p; count--; s++)
- s->repo = repo;
- return p;
-}
-
-
#define FOR_REPO_SOLVABLES(r, p, s) \
for (p = (r)->start, s = (r)->pool->solvables + p; p < (r)->end; p++, s = (r)->pool->solvables + p) \
if (s->repo == (r))
if (solv->nrules <= 2) /* nothing to unify */
return;
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- unifyrules -----\n");
-
/* sort rules first */
sat_sort(solv->rules + 1, solv->nrules - 1, sizeof(Rule), unifyrules_sortcmp, solv->pool);
POOL_DEBUG(SAT_DEBUG_STATS, " binary: %d\n", binr);
POOL_DEBUG(SAT_DEBUG_STATS, " normal: %d, %d literals\n", solv->nrules - 1 - binr, lits);
}
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- unifyrules end -----\n");
}
#if 0
Id *dp; /* ptr to 'whatprovides' */
Id n; /* Id for current solvable 's' */
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforsolvable -----\n");
-
queue_init_buffer(&workq, workqbuf, sizeof(workqbuf)/sizeof(*workqbuf));
queue_push(&workq, s - pool->solvables); /* push solvable Id to work queue */
}
}
queue_free(&workq);
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforsolvable end -----\n");
}
Id sup, *supp;
int i, n;
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforweak -----\n");
/* foreach solvable in pool */
for (i = n = 1; n < pool->nsolvables; i++, n++)
{
solver_addrpmrulesforsolvable(solv, s, m);
n = 0; /* check all solvables again because we added solvables to m */
}
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforweak end -----\n");
}
Queue qs;
Id qsbuf[64];
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforupdaters -----\n");
-
queue_init_buffer(&qs, qsbuf, sizeof(qsbuf)/sizeof(*qsbuf));
/* find update candidates for 's' */
policy_findupdatepackages(solv, s, &qs, allow_all);
if (!MAPTST(m, qs.elements[i]))
solver_addrpmrulesforsolvable(solv, pool->solvables + qs.elements[i], m);
queue_free(&qs);
-
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addrpmrulesforupdaters -----\n");
}
Queue qs;
Id qsbuf[64];
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addupdaterule -----\n");
queue_init_buffer(&qs, qsbuf, sizeof(qsbuf)/sizeof(*qsbuf));
p = s - pool->solvables;
/* find update candidates for 's' */
d = qs.count ? pool_queuetowhatprovides(pool, &qs) : 0;
queue_free(&qs);
solver_addrule(solv, p, d); /* allow update of s */
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- addupdaterule end -----\n");
}
static inline void
int decisionstart;
int record_proof = 1;
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- makeruledecisions ; size decisionq: %d -----\n",solv->decisionq.count);
-
/* The system solvable is always installed first */
assert(solv->decisionq.count == 0);
queue_push(&solv->decisionq, SYSTEMSOLVABLE);
if (v < 0)
solver_reenablepolicyrules(solv, -(v + 1));
}
-
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- makeruledecisions end; size decisionq: %d -----\n",solv->decisionq.count);
}
POOL_DEBUG(SAT_DEBUG_SOLVER, "initial decisions: %d\n", solv->decisionq.count);
- IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
- solver_printdecisions(solv);
-
/* start SAT algorithm */
level = 1;
systemlevel = level + 1;
Rule *r;
Id *decisionmap = solv->decisionmap;
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "removedisabledconflicts\n");
queue_empty(removed);
for (i = 0; i < solv->decisionq.count; i++)
{
if (r->d < 0 && decisionmap[-p])
{
/* rule is now disabled, remove from decisionmap */
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "removing conflict for package %s[%d]\n", pool_solvid2str(pool, -p), -p);
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "removing conflict for package %s[%d]\n", pool_solvid2str(pool, -p), -p);
queue_push(removed, -p);
queue_push(removed, decisionmap[-p]);
decisionmap[-p] = 0;
}
if (new)
{
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "re-conflicting package %s[%d]\n", pool_solvid2str(pool, -new), -new);
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "re-conflicting package %s[%d]\n", pool_solvid2str(pool, -new), -new);
decisionmap[-new] = -1;
new = 0;
n = 0; /* redo all rules */
}
oldnrules = solv->nrules;
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** create rpm rules for installed solvables ***\n");
FOR_REPO_SOLVABLES(installed, p, s)
solver_addrpmrulesforsolvable(solv, s, &addedmap);
POOL_DEBUG(SAT_DEBUG_STATS, "added %d rpm rules for installed solvables\n", solv->nrules - oldnrules);
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** create rpm rules for updaters of installed solvables ***\n");
oldnrules = solv->nrules;
FOR_REPO_SOLVABLES(installed, p, s)
solver_addrpmrulesforupdaters(solv, s, &addedmap, 1);
* (to be installed or removed)
*/
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** create rpm rules for packages involved with a job ***\n");
oldnrules = solv->nrules;
for (i = 0; i < job->count; i += 2)
{
/*
* add rules for suggests, enhances
*/
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** create rpm rules for suggested/enhanced packages ***\n");
oldnrules = solv->nrules;
solver_addrpmrulesforweak(solv, &addedmap);
POOL_DEBUG(SAT_DEBUG_STATS, "added %d rpm rules because of weak dependencies\n", solv->nrules - oldnrules);
* best effort mode
*/
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** Add feature rules ***\n");
solv->featurerules = solv->nrules; /* mark start of feature rules */
if (installed)
{
* except that downgrades/archchanges/vendorchanges are not allowed
*/
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** Add update rules ***\n");
solv->updaterules = solv->nrules;
if (installed)
* now add all job rules
*/
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "*** Add JOB rules ***\n");
-
solv->jobrules = solv->nrules;
for (i = 0; i < job->count; i += 2)
{
Solvable *s;
Queue iq;
- IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
- {
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions -----\n");
- for (i = 0; i < solv->decisionq.count; i++)
- {
- p = solv->decisionq.elements[i];
- solver_printruleelement(solv, SAT_DEBUG_SCHUBI, 0, p);
- }
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions end -----\n");
- }
-
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
POOL_DEBUG(SAT_DEBUG_RESULT, "transaction:\n");