2 * Copyright (c) 2008, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * debug functions for the SAT solver
21 #include "solverdebug.h"
31 * create obsoletesmap from solver decisions
33 * for solvables in installed repo:
35 * p - one of the packages that obsolete us
37 * n - number of packages this package obsoletes
41 /* OBSOLETE: use transaction code instead! */
44 solver_create_decisions_obsoletesmap(Solver *solv)
46 Pool *pool = solv->pool;
47 Repo *installed = solv->installed;
48 Id p, *obsoletesmap = NULL;
52 obsoletesmap = (Id *)sat_calloc(pool->nsolvables, sizeof(Id));
55 for (i = 0; i < solv->decisionq.count; i++)
60 n = solv->decisionq.elements[i];
63 if (n == SYSTEMSOLVABLE)
65 s = pool->solvables + n;
66 if (s->repo == installed) /* obsoletes don't count for already installed packages */
68 noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n);
69 FOR_PROVIDES(p, pp, s->name)
71 Solvable *ps = pool->solvables + p;
72 if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
74 if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
76 if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
78 if (ps->repo == installed && !obsoletesmap[p])
85 for (i = 0; i < solv->decisionq.count; i++)
90 n = solv->decisionq.elements[i];
93 if (n == SYSTEMSOLVABLE)
95 s = pool->solvables + n;
96 if (s->repo == installed) /* obsoletes don't count for already installed packages */
100 if (solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n))
102 obsp = s->repo->idarraydata + s->obsoletes;
103 while ((obs = *obsp++) != 0)
105 FOR_PROVIDES(p, pp, obs)
107 Solvable *ps = pool->solvables + p;
108 if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, ps, obs))
110 if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
112 if (pool->solvables[p].repo == installed && !obsoletesmap[p])
125 solver_printruleelement(Solver *solv, int type, Rule *r, Id v)
127 Pool *pool = solv->pool;
131 s = pool->solvables + -v;
132 POOL_DEBUG(type, " !%s [%d]", solvable2str(pool, s), -v);
136 s = pool->solvables + v;
137 POOL_DEBUG(type, " %s [%d]", solvable2str(pool, s), v);
139 if (pool->installed && s->repo == pool->installed)
140 POOL_DEBUG(type, "I");
144 POOL_DEBUG(type, " (w1)");
146 POOL_DEBUG(type, " (w2)");
148 if (solv->decisionmap[s - pool->solvables] > 0)
149 POOL_DEBUG(type, " Install.level%d", solv->decisionmap[s - pool->solvables]);
150 if (solv->decisionmap[s - pool->solvables] < 0)
151 POOL_DEBUG(type, " Conflict.level%d", -solv->decisionmap[s - pool->solvables]);
152 POOL_DEBUG(type, "\n");
161 solver_printrule(Solver *solv, int type, Rule *r)
163 Pool *pool = solv->pool;
167 if (r >= solv->rules && r < solv->rules + solv->nrules) /* r is a solver rule */
168 POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules));
170 POOL_DEBUG(type, "Rule:"); /* r is any rule */
172 POOL_DEBUG(type, " (disabled)");
173 POOL_DEBUG(type, "\n");
174 d = r->d < 0 ? -r->d - 1 : r->d;
178 /* print direct literal */
184 /* binary rule --> print w2 as second literal */
188 /* every other which is in d */
189 v = solv->pool->whatprovidesdata[d + i - 1];
192 solver_printruleelement(solv, type, r, v);
194 POOL_DEBUG(type, " next rules: %d %d\n", r->n1, r->n2);
198 solver_printruleclass(Solver *solv, int type, Rule *r)
200 Pool *pool = solv->pool;
201 Id p = r - solv->rules;
203 if (p < solv->learntrules)
204 if (MAPTST(&solv->weakrulemap, p))
205 POOL_DEBUG(type, "WEAK ");
206 if (solv->learntrules && p >= solv->learntrules)
207 POOL_DEBUG(type, "LEARNT ");
208 else if (p >= solv->choicerules && p < solv->choicerules_end)
209 POOL_DEBUG(type, "CHOICE ");
210 else if (p >= solv->infarchrules && p < solv->infarchrules_end)
211 POOL_DEBUG(type, "INFARCH ");
212 else if (p >= solv->duprules && p < solv->duprules_end)
213 POOL_DEBUG(type, "DUP ");
214 else if (p >= solv->jobrules && p < solv->jobrules_end)
215 POOL_DEBUG(type, "JOB ");
216 else if (p >= solv->updaterules && p < solv->updaterules_end)
217 POOL_DEBUG(type, "UPDATE ");
218 else if (p >= solv->featurerules && p < solv->featurerules_end)
219 POOL_DEBUG(type, "FEATURE ");
220 solver_printrule(solv, type, r);
224 solver_printproblem(Solver *solv, Id v)
226 Pool *pool = solv->pool;
232 solver_printruleclass(solv, SAT_DEBUG_SOLUTIONS, solv->rules + v);
236 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "JOB %d\n", v);
237 jp = solv->ruletojob.elements;
238 for (i = solv->jobrules, r = solv->rules + i; i < solv->jobrules_end; i++, r++, jp++)
241 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "- ");
242 solver_printrule(solv, SAT_DEBUG_SOLUTIONS, r);
244 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "ENDJOB\n");
249 solver_printwatches(Solver *solv, int type)
251 Pool *pool = solv->pool;
254 POOL_DEBUG(type, "Watches: \n");
255 for (counter = -(pool->nsolvables - 1); counter < pool->nsolvables; counter++)
256 POOL_DEBUG(type, " solvable [%d] -- rule [%d]\n", counter, solv->watches[counter + pool->nsolvables]);
260 solver_printdecisionq(Solver *solv, int type)
262 Pool *pool = solv->pool;
266 POOL_DEBUG(type, "Decisions:\n");
267 for (i = 0; i < solv->decisionq.count; i++)
269 p = solv->decisionq.elements[i];
271 POOL_DEBUG(type, "%d %d install %s, ", i, solv->decisionmap[p], solvid2str(pool, p));
273 POOL_DEBUG(type, "%d %d conflict %s, ", i, -solv->decisionmap[-p], solvid2str(pool, -p));
274 why = solv->decisionq_why.elements[i];
277 POOL_DEBUG(type, "forced by ");
278 solver_printruleclass(solv, type, solv->rules + why);
282 POOL_DEBUG(type, "chosen from ");
283 solver_printruleclass(solv, type, solv->rules - why);
286 POOL_DEBUG(type, "picked for some unknown reason.\n");
295 solver_printdecisions(Solver *solv)
297 Pool *pool = solv->pool;
298 Repo *installed = solv->installed;
304 IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
306 POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions -----\n");
307 for (i = 0; i < solv->decisionq.count; i++)
309 p = solv->decisionq.elements[i];
310 solver_printruleelement(solv, SAT_DEBUG_SCHUBI, 0, p);
312 POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions end -----\n");
315 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
316 POOL_DEBUG(SAT_DEBUG_RESULT, "transaction:\n");
319 for (i = 0; i < solv->trans.steps.count; i++)
321 p = solv->trans.steps.elements[i];
322 s = pool->solvables + p;
323 type = transaction_type(&solv->trans, p, SOLVER_TRANSACTION_SHOW_ACTIVE|SOLVER_TRANSACTION_SHOW_ALL|SOLVER_TRANSACTION_SHOW_OBSOLETES|SOLVER_TRANSACTION_SHOW_MULTIINSTALL);
326 case SOLVER_TRANSACTION_MULTIINSTALL:
327 POOL_DEBUG(SAT_DEBUG_RESULT, " multi install %s", solvable2str(pool, s));
329 case SOLVER_TRANSACTION_MULTIREINSTALL:
330 POOL_DEBUG(SAT_DEBUG_RESULT, " multi reinstall %s", solvable2str(pool, s));
332 case SOLVER_TRANSACTION_INSTALL:
333 POOL_DEBUG(SAT_DEBUG_RESULT, " install %s", solvable2str(pool, s));
335 case SOLVER_TRANSACTION_REINSTALL:
336 POOL_DEBUG(SAT_DEBUG_RESULT, " reinstall %s", solvable2str(pool, s));
338 case SOLVER_TRANSACTION_DOWNGRADE:
339 POOL_DEBUG(SAT_DEBUG_RESULT, " downgrade %s", solvable2str(pool, s));
341 case SOLVER_TRANSACTION_CHANGE:
342 POOL_DEBUG(SAT_DEBUG_RESULT, " change %s", solvable2str(pool, s));
344 case SOLVER_TRANSACTION_UPGRADE:
345 case SOLVER_TRANSACTION_OBSOLETES:
346 POOL_DEBUG(SAT_DEBUG_RESULT, " upgrade %s", solvable2str(pool, s));
348 case SOLVER_TRANSACTION_ERASE:
349 POOL_DEBUG(SAT_DEBUG_RESULT, " erase %s", solvable2str(pool, s));
356 case SOLVER_TRANSACTION_INSTALL:
357 case SOLVER_TRANSACTION_ERASE:
358 case SOLVER_TRANSACTION_MULTIINSTALL:
359 case SOLVER_TRANSACTION_MULTIREINSTALL:
360 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
362 case SOLVER_TRANSACTION_REINSTALL:
363 case SOLVER_TRANSACTION_DOWNGRADE:
364 case SOLVER_TRANSACTION_CHANGE:
365 case SOLVER_TRANSACTION_UPGRADE:
366 case SOLVER_TRANSACTION_OBSOLETES:
367 transaction_all_obs_pkgs(&solv->trans, p, &iq);
370 POOL_DEBUG(SAT_DEBUG_RESULT, " (obsoletes");
371 for (j = 0; j < iq.count; j++)
372 POOL_DEBUG(SAT_DEBUG_RESULT, " %s", solvid2str(pool, iq.elements[j]));
373 POOL_DEBUG(SAT_DEBUG_RESULT, ")");
375 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
383 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
385 if (solv->recommendations.count)
387 POOL_DEBUG(SAT_DEBUG_RESULT, "recommended packages:\n");
388 for (i = 0; i < solv->recommendations.count; i++)
390 s = pool->solvables + solv->recommendations.elements[i];
391 if (solv->decisionmap[solv->recommendations.elements[i]] > 0)
393 if (installed && s->repo == installed)
394 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
396 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
399 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
401 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
404 if (solv->suggestions.count)
406 POOL_DEBUG(SAT_DEBUG_RESULT, "suggested packages:\n");
407 for (i = 0; i < solv->suggestions.count; i++)
409 s = pool->solvables + solv->suggestions.elements[i];
410 if (solv->decisionmap[solv->suggestions.elements[i]] > 0)
412 if (installed && s->repo == installed)
413 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
415 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
418 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
420 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
422 if (solv->orphaned.count)
424 POOL_DEBUG(SAT_DEBUG_RESULT, "orphaned packages:\n");
425 for (i = 0; i < solv->orphaned.count; i++)
427 s = pool->solvables + solv->orphaned.elements[i];
428 if (solv->decisionmap[solv->orphaned.elements[i]] > 0)
429 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (kept)\n", solvable2str(pool, s));
431 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (erased)\n", solvable2str(pool, s));
433 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
438 const char *id2strnone(Pool *pool, Id id)
440 return !id || id == 1 ? "(none)" : id2str(pool, id);
444 solver_printtransaction(Solver *solv)
446 Transaction *trans = &solv->trans;
447 Pool *pool = trans->pool;
449 int i, j, mode, l, linel;
453 queue_init(&classes);
456 transaction_classify(trans, mode, &classes);
457 for (i = 0; i < classes.count; i += 4)
459 Id class = classes.elements[i];
460 Id cnt = classes.elements[i + 1];
463 case SOLVER_TRANSACTION_ERASE:
464 POOL_DEBUG(SAT_DEBUG_RESULT, "%d erased packages:\n", cnt);
466 case SOLVER_TRANSACTION_INSTALL:
467 POOL_DEBUG(SAT_DEBUG_RESULT, "%d installed packages:\n", cnt);
469 case SOLVER_TRANSACTION_REINSTALLED:
470 POOL_DEBUG(SAT_DEBUG_RESULT, "%d reinstalled packages:\n", cnt);
472 case SOLVER_TRANSACTION_DOWNGRADED:
473 POOL_DEBUG(SAT_DEBUG_RESULT, "%d downgraded packages:\n", cnt);
475 case SOLVER_TRANSACTION_CHANGED:
476 POOL_DEBUG(SAT_DEBUG_RESULT, "%d changed packages:\n", cnt);
478 case SOLVER_TRANSACTION_UPGRADED:
479 POOL_DEBUG(SAT_DEBUG_RESULT, "%d upgraded packages:\n", cnt);
481 case SOLVER_TRANSACTION_VENDORCHANGE:
482 POOL_DEBUG(SAT_DEBUG_RESULT, "%d vendor changes from '%s' to '%s':\n", cnt, id2strnone(pool, classes.elements[i + 2]), id2strnone(pool, classes.elements[i + 3]));
484 case SOLVER_TRANSACTION_ARCHCHANGE:
485 POOL_DEBUG(SAT_DEBUG_RESULT, "%d arch changes from %s to %s:\n", cnt, id2str(pool, classes.elements[i + 2]), id2str(pool, classes.elements[i + 3]));
488 class = SOLVER_TRANSACTION_IGNORE;
491 if (class == SOLVER_TRANSACTION_IGNORE)
493 transaction_classify_pkgs(trans, mode, class, classes.elements[i + 2], classes.elements[i + 3], &pkgs);
496 for (j = 0; j < pkgs.count; j++)
498 Id p = pkgs.elements[j];
499 Solvable *s = pool->solvables + p;
504 case SOLVER_TRANSACTION_DOWNGRADED:
505 case SOLVER_TRANSACTION_UPGRADED:
506 s2 = pool->solvables + transaction_obs_pkg(trans, p);
507 POOL_DEBUG(SAT_DEBUG_RESULT, " - %s -> %s\n", solvable2str(pool, s), solvable2str(pool, s2));
509 case SOLVER_TRANSACTION_VENDORCHANGE:
510 case SOLVER_TRANSACTION_ARCHCHANGE:
511 n = id2str(pool, s->name);
513 if (l + linel > sizeof(line) - 3)
516 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", line);
520 if (l + linel > sizeof(line) - 3)
521 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", n);
526 strcpy(line + linel, ", ");
529 strcpy(line + linel, n);
534 POOL_DEBUG(SAT_DEBUG_RESULT, " - %s\n", solvable2str(pool, s));
539 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", line);
540 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
542 queue_free(&classes);
547 solver_printproblemruleinfo(Solver *solv, Id probr)
549 Pool *pool = solv->pool;
550 Id dep, source, target;
552 switch (solver_ruleinfo(solv, probr, &source, &target, &dep))
554 case SOLVER_RULE_DISTUPGRADE:
555 POOL_DEBUG(SAT_DEBUG_RESULT, "%s does not belong to a distupgrade repository\n", solvid2str(pool, source));
557 case SOLVER_RULE_INFARCH:
558 POOL_DEBUG(SAT_DEBUG_RESULT, "%s has inferior architecture\n", solvid2str(pool, source));
560 case SOLVER_RULE_UPDATE:
561 POOL_DEBUG(SAT_DEBUG_RESULT, "problem with installed package %s\n", solvid2str(pool, source));
563 case SOLVER_RULE_JOB:
564 POOL_DEBUG(SAT_DEBUG_RESULT, "conflicting requests\n");
566 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
567 POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides requested %s\n", dep2str(pool, dep));
569 case SOLVER_RULE_RPM:
570 POOL_DEBUG(SAT_DEBUG_RESULT, "some dependency problem\n");
572 case SOLVER_RULE_RPM_NOT_INSTALLABLE:
573 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s is not installable\n", solvid2str(pool, source));
575 case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
576 POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides %s needed by %s\n", dep2str(pool, dep), solvid2str(pool, source));
578 case SOLVER_RULE_RPM_SAME_NAME:
579 POOL_DEBUG(SAT_DEBUG_RESULT, "cannot install both %s and %s\n", solvid2str(pool, source), solvid2str(pool, target));
581 case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
582 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
584 case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
585 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
587 case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
588 POOL_DEBUG(SAT_DEBUG_RESULT, "installed package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
590 case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
591 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s implicitely obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
593 case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
594 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", solvid2str(pool, source), dep2str(pool, dep));
596 case SOLVER_RULE_RPM_SELF_CONFLICT:
597 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", solvid2str(pool, source), dep2str(pool, dep));
599 case SOLVER_RULE_UNKNOWN:
600 case SOLVER_RULE_FEATURE:
601 case SOLVER_RULE_LEARNT:
602 case SOLVER_RULE_CHOICE:
603 POOL_DEBUG(SAT_DEBUG_RESULT, "bad rule type\n");
609 solver_printprobleminfo(Solver *solv, Id problem)
611 solver_printproblemruleinfo(solv, solver_findproblemrule(solv, problem));
615 solver_printcompleteprobleminfo(Solver *solv, Id problem)
622 solver_findallproblemrules(solv, problem, &q);
623 for (i = 0; i < q.count; i++)
625 probr = q.elements[i];
626 if (!(probr >= solv->updaterules && probr < solv->updaterules_end) && !(probr >= solv->jobrules && probr < solv->jobrules_end))
632 for (i = 0; i < q.count; i++)
634 probr = q.elements[i];
635 if (nobad && ((probr >= solv->updaterules && probr < solv->updaterules_end) || (probr >= solv->jobrules && probr < solv->jobrules_end)))
637 solver_printproblemruleinfo(solv, probr);
643 solver_printsolution(Solver *solv, Id problem, Id solution)
645 Pool *pool = solv->pool;
646 Id p, rp, element, how, what, select;
650 while ((element = solver_next_solutionelement(solv, problem, solution, element, &p, &rp)) != 0)
652 if (p == SOLVER_SOLUTION_JOB)
654 /* job, rp is index into job queue */
655 how = solv->job.elements[rp - 1];
656 what = solv->job.elements[rp];
657 select = how & SOLVER_SELECTMASK;
658 switch (how & SOLVER_JOBMASK)
661 if (select == SOLVER_SOLVABLE && solv->installed && pool->solvables[what].repo == solv->installed)
662 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not keep %s installed\n", solvid2str(pool, what));
663 else if (select == SOLVER_SOLVABLE_PROVIDES)
664 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install a solvable %s\n", solver_select2str(solv, select, what));
666 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install %s\n", solver_select2str(solv, select, what));
669 if (select == SOLVER_SOLVABLE && !(solv->installed && pool->solvables[what].repo == solv->installed))
670 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not forbid installation of %s\n", solvid2str(pool, what));
671 else if (select == SOLVER_SOLVABLE_PROVIDES)
672 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not deinstall all solvables %s\n", solver_select2str(solv, select, what));
674 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not deinstall %s\n", solver_select2str(solv, select, what));
677 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install most recent version of %s\n", solver_select2str(solv, select, what));
680 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not lock %s\n", solver_select2str(solv, select, what));
683 POOL_DEBUG(SAT_DEBUG_RESULT, " - do something different\n");
687 else if (p == SOLVER_SOLUTION_INFARCH)
689 s = pool->solvables + rp;
690 if (solv->installed && s->repo == solv->installed)
691 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep %s despite the inferior architecture\n", solvable2str(pool, s));
693 POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s despite the inferior architecture\n", solvable2str(pool, s));
695 else if (p == SOLVER_SOLUTION_DISTUPGRADE)
697 s = pool->solvables + rp;
698 if (solv->installed && s->repo == solv->installed)
699 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", solvable2str(pool, s));
701 POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s from excluded repository\n", solvable2str(pool, s));
705 /* policy, replace p with rp */
706 s = pool->solvables + p;
707 sd = rp ? pool->solvables + rp : 0;
708 if (s == sd && solv->distupgrade)
710 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", solvable2str(pool, s));
715 if (!solv->allowdowngrade && evrcmp(pool, s->evr, sd->evr, EVRCMP_MATCH_RELEASE) > 0)
717 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow downgrade of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
720 if (!solv->allowarchchange && s->name == sd->name && s->arch != sd->arch && policy_illegal_archchange(solv, s, sd))
722 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow architecture change of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
725 if (!solv->allowvendorchange && s->name == sd->name && s->vendor != sd->vendor && policy_illegal_vendorchange(solv, s, sd))
728 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to '%s' (%s)\n", id2str(pool, s->vendor), solvable2str(pool, s), id2str(pool, sd->vendor), solvable2str(pool, sd));
730 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to no vendor (%s)\n", id2str(pool, s->vendor), solvable2str(pool, s), solvable2str(pool, sd));
734 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow replacement of %s with %s\n", solvable2str(pool, s), solvable2str(pool, sd));
738 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow deinstallation of %s\n", solvable2str(pool, s));
746 solver_printallsolutions(Solver *solv)
748 Pool *pool = solv->pool;
750 Id problem, solution;
752 POOL_DEBUG(SAT_DEBUG_RESULT, "Encountered problems! Here are the solutions:\n\n");
755 while ((problem = solver_next_problem(solv, problem)) != 0)
758 POOL_DEBUG(SAT_DEBUG_RESULT, "Problem %d:\n", pcnt);
759 POOL_DEBUG(SAT_DEBUG_RESULT, "====================================\n");
761 solver_printprobleminfo(solv, problem);
763 solver_printcompleteprobleminfo(solv, problem);
765 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
767 while ((solution = solver_next_solution(solv, problem, solution)) != 0)
769 solver_printsolution(solv, problem, solution);
770 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
776 solver_printtrivial(Solver *solv)
778 Pool *pool = solv->pool;
786 for (p = 1, s = pool->solvables + p; p < solv->pool->nsolvables; p++, s++)
788 n = id2str(pool, s->name);
789 if (strncmp(n, "patch:", 6) != 0 && strncmp(n, "pattern:", 8) != 0)
799 solver_trivial_installable(solv, &in, &out);
800 POOL_DEBUG(SAT_DEBUG_RESULT, "trivial installable status:\n");
801 for (i = 0; i < in.count; i++)
802 POOL_DEBUG(SAT_DEBUG_RESULT, " %s: %d\n", solvid2str(pool, in.elements[i]), out.elements[i]);
803 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
809 solver_select2str(Solver *solv, Id select, Id what)
811 Pool *pool = solv->pool;
814 if (select == SOLVER_SOLVABLE)
815 return solvid2str(pool, what);
816 if (select == SOLVER_SOLVABLE_NAME)
817 return dep2str(pool, what);
818 if (select == SOLVER_SOLVABLE_PROVIDES)
820 s = dep2str(pool, what);
821 b = pool_alloctmpspace(pool, 11 + strlen(s));
822 sprintf(b, "providing %s", s);
825 if (select == SOLVER_SOLVABLE_ONE_OF)
830 while ((p = pool->whatprovidesdata[what++]) != 0)
832 s = solvid2str(pool, p);
833 b2 = pool_alloctmpspace(pool, strlen(b) + strlen(s) + 3);
834 sprintf(b2, "%s, %s", b, s);
837 return *b ? b + 2 : "nothing";
839 if (select == SOLVER_SOLVABLE_REPO)
841 b = pool_alloctmpspace(pool, 20);
842 sprintf(b, "repo #%d", what);
845 return "unknown job select";