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"
30 * create obsoletesmap from solver decisions
32 * for solvables in installed repo:
34 * p - one of the packages that obsolete us
36 * n - number of packages this package obsoletes
40 /* OBSOLETE: use transaction code instead! */
43 solver_create_decisions_obsoletesmap(Solver *solv)
45 Pool *pool = solv->pool;
46 Repo *installed = solv->installed;
47 Id p, *obsoletesmap = NULL;
51 obsoletesmap = (Id *)sat_calloc(pool->nsolvables, sizeof(Id));
54 for (i = 0; i < solv->decisionq.count; i++)
59 n = solv->decisionq.elements[i];
62 if (n == SYSTEMSOLVABLE)
64 s = pool->solvables + n;
65 if (s->repo == installed) /* obsoletes don't count for already installed packages */
67 noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n);
68 FOR_PROVIDES(p, pp, s->name)
70 Solvable *ps = pool->solvables + p;
71 if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
73 if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
75 if (pool->solvables[p].repo == installed && !obsoletesmap[p])
82 for (i = 0; i < solv->decisionq.count; i++)
87 n = solv->decisionq.elements[i];
90 if (n == SYSTEMSOLVABLE)
92 s = pool->solvables + n;
93 if (s->repo == installed) /* obsoletes don't count for already installed packages */
97 if (solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n))
99 obsp = s->repo->idarraydata + s->obsoletes;
100 while ((obs = *obsp++) != 0)
102 FOR_PROVIDES(p, pp, obs)
104 if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
106 if (pool->solvables[p].repo == installed && !obsoletesmap[p])
119 solver_printruleelement(Solver *solv, int type, Rule *r, Id v)
121 Pool *pool = solv->pool;
125 s = pool->solvables + -v;
126 POOL_DEBUG(type, " !%s [%d]", solvable2str(pool, s), -v);
130 s = pool->solvables + v;
131 POOL_DEBUG(type, " %s [%d]", solvable2str(pool, s), v);
136 POOL_DEBUG(type, " (w1)");
138 POOL_DEBUG(type, " (w2)");
140 if (solv->decisionmap[s - pool->solvables] > 0)
141 POOL_DEBUG(type, " Install.level%d", solv->decisionmap[s - pool->solvables]);
142 if (solv->decisionmap[s - pool->solvables] < 0)
143 POOL_DEBUG(type, " Conflict.level%d", -solv->decisionmap[s - pool->solvables]);
144 POOL_DEBUG(type, "\n");
153 solver_printrule(Solver *solv, int type, Rule *r)
155 Pool *pool = solv->pool;
159 if (r >= solv->rules && r < solv->rules + solv->nrules) /* r is a solver rule */
160 POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules));
162 POOL_DEBUG(type, "Rule:"); /* r is any rule */
164 POOL_DEBUG(type, " (disabled)");
165 POOL_DEBUG(type, "\n");
166 d = r->d < 0 ? -r->d - 1 : r->d;
170 /* print direct literal */
176 /* binary rule --> print w2 as second literal */
180 /* every other which is in d */
181 v = solv->pool->whatprovidesdata[d + i - 1];
184 solver_printruleelement(solv, type, r, v);
186 POOL_DEBUG(type, " next rules: %d %d\n", r->n1, r->n2);
190 solver_printruleclass(Solver *solv, int type, Rule *r)
192 Pool *pool = solv->pool;
193 Id p = r - solv->rules;
195 if (p < solv->learntrules)
196 if (MAPTST(&solv->weakrulemap, p))
197 POOL_DEBUG(type, "WEAK ");
198 if (p >= solv->learntrules)
199 POOL_DEBUG(type, "LEARNT ");
200 else if (p >= solv->infarchrules && p < solv->infarchrules_end)
201 POOL_DEBUG(type, "INFARCH ");
202 else if (p >= solv->duprules && p < solv->duprules_end)
203 POOL_DEBUG(type, "DUP ");
204 else if (p >= solv->jobrules && p < solv->jobrules_end)
205 POOL_DEBUG(type, "JOB ");
206 else if (p >= solv->updaterules && p < solv->updaterules_end)
207 POOL_DEBUG(type, "UPDATE ");
208 else if (p >= solv->featurerules && p < solv->featurerules_end)
209 POOL_DEBUG(type, "FEATURE ");
210 solver_printrule(solv, type, r);
214 solver_printproblem(Solver *solv, Id v)
216 Pool *pool = solv->pool;
222 solver_printruleclass(solv, SAT_DEBUG_SOLUTIONS, solv->rules + v);
226 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "JOB %d\n", v);
227 jp = solv->ruletojob.elements;
228 for (i = solv->jobrules, r = solv->rules + i; i < solv->jobrules_end; i++, r++, jp++)
231 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "- ");
232 solver_printrule(solv, SAT_DEBUG_SOLUTIONS, r);
234 POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "ENDJOB\n");
239 solver_printwatches(Solver *solv, int type)
241 Pool *pool = solv->pool;
244 POOL_DEBUG(type, "Watches: \n");
245 for (counter = -(pool->nsolvables - 1); counter < pool->nsolvables; counter++)
246 POOL_DEBUG(type, " solvable [%d] -- rule [%d]\n", counter, solv->watches[counter + pool->nsolvables]);
254 solver_printdecisions(Solver *solv)
256 Pool *pool = solv->pool;
257 Repo *installed = solv->installed;
263 IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
265 POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions -----\n");
266 for (i = 0; i < solv->decisionq.count; i++)
268 p = solv->decisionq.elements[i];
269 solver_printruleelement(solv, SAT_DEBUG_SCHUBI, 0, p);
271 POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions end -----\n");
274 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
275 POOL_DEBUG(SAT_DEBUG_RESULT, "transaction:\n");
278 for (i = 0; i < solv->trans.steps.count; i++)
280 p = solv->trans.steps.elements[i];
281 s = pool->solvables + p;
282 type = transaction_type(&solv->trans, p, SOLVER_TRANSACTION_SHOW_ACTIVE|SOLVER_TRANSACTION_SHOW_ALL|SOLVER_TRANSACTION_SHOW_OBSOLETES|SOLVER_TRANSACTION_SHOW_MULTIINSTALL);
285 case SOLVER_TRANSACTION_MULTIINSTALL:
286 POOL_DEBUG(SAT_DEBUG_RESULT, " multi install %s", solvable2str(pool, s));
288 case SOLVER_TRANSACTION_MULTIREINSTALL:
289 POOL_DEBUG(SAT_DEBUG_RESULT, " multi reinstall %s", solvable2str(pool, s));
291 case SOLVER_TRANSACTION_INSTALL:
292 POOL_DEBUG(SAT_DEBUG_RESULT, " install %s", solvable2str(pool, s));
294 case SOLVER_TRANSACTION_REINSTALL:
295 POOL_DEBUG(SAT_DEBUG_RESULT, " reinstall %s", solvable2str(pool, s));
297 case SOLVER_TRANSACTION_DOWNGRADE:
298 POOL_DEBUG(SAT_DEBUG_RESULT, " downgrade %s", solvable2str(pool, s));
300 case SOLVER_TRANSACTION_CHANGE:
301 POOL_DEBUG(SAT_DEBUG_RESULT, " change %s", solvable2str(pool, s));
303 case SOLVER_TRANSACTION_UPGRADE:
304 case SOLVER_TRANSACTION_OBSOLETES:
305 POOL_DEBUG(SAT_DEBUG_RESULT, " upgrade %s", solvable2str(pool, s));
307 case SOLVER_TRANSACTION_ERASE:
308 POOL_DEBUG(SAT_DEBUG_RESULT, " erase %s", solvable2str(pool, s));
315 case SOLVER_TRANSACTION_INSTALL:
316 case SOLVER_TRANSACTION_ERASE:
317 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
319 case SOLVER_TRANSACTION_REINSTALL:
320 case SOLVER_TRANSACTION_DOWNGRADE:
321 case SOLVER_TRANSACTION_CHANGE:
322 case SOLVER_TRANSACTION_UPGRADE:
323 case SOLVER_TRANSACTION_OBSOLETES:
324 transaction_all_obs_pkgs(&solv->trans, p, &iq);
327 POOL_DEBUG(SAT_DEBUG_RESULT, " (obsoletes");
328 for (j = 0; j < iq.count; j++)
329 POOL_DEBUG(SAT_DEBUG_RESULT, " %s", solvid2str(pool, iq.elements[j]));
330 POOL_DEBUG(SAT_DEBUG_RESULT, ")");
332 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
340 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
342 if (solv->recommendations.count)
344 POOL_DEBUG(SAT_DEBUG_RESULT, "recommended packages:\n");
345 for (i = 0; i < solv->recommendations.count; i++)
347 s = pool->solvables + solv->recommendations.elements[i];
348 if (solv->decisionmap[solv->recommendations.elements[i]] > 0)
350 if (installed && s->repo == installed)
351 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
353 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
356 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
358 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
361 if (solv->suggestions.count)
363 POOL_DEBUG(SAT_DEBUG_RESULT, "suggested packages:\n");
364 for (i = 0; i < solv->suggestions.count; i++)
366 s = pool->solvables + solv->suggestions.elements[i];
367 if (solv->decisionmap[solv->suggestions.elements[i]] > 0)
369 if (installed && s->repo == installed)
370 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
372 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
375 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
377 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
379 if (solv->orphaned.count)
381 POOL_DEBUG(SAT_DEBUG_RESULT, "orphaned packages:\n");
382 for (i = 0; i < solv->orphaned.count; i++)
384 s = pool->solvables + solv->orphaned.elements[i];
385 if (solv->decisionmap[solv->orphaned.elements[i]] > 0)
386 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (kept)\n", solvable2str(pool, s));
388 POOL_DEBUG(SAT_DEBUG_RESULT, " %s (erased)\n", solvable2str(pool, s));
390 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
395 const char *id2strnone(Pool *pool, Id id)
397 return !id || id == 1 ? "(none)" : id2str(pool, id);
401 solver_printtransaction(Solver *solv)
403 Transaction *trans = &solv->trans;
404 Pool *pool = trans->pool;
406 int i, j, mode, l, linel;
410 queue_init(&classes);
413 transaction_classify(trans, mode, &classes);
414 for (i = 0; i < classes.count; i += 4)
416 Id class = classes.elements[i];
417 Id cnt = classes.elements[i + 1];
420 case SOLVER_TRANSACTION_ERASE:
421 POOL_DEBUG(SAT_DEBUG_RESULT, "erased packages (%d):\n", cnt);
423 case SOLVER_TRANSACTION_INSTALL:
424 POOL_DEBUG(SAT_DEBUG_RESULT, "installed packages (%d):\n", cnt);
426 case SOLVER_TRANSACTION_REINSTALLED:
427 POOL_DEBUG(SAT_DEBUG_RESULT, "reinstalled packages (%d):\n", cnt);
429 case SOLVER_TRANSACTION_DOWNGRADED:
430 POOL_DEBUG(SAT_DEBUG_RESULT, "downgraded packages (%d):\n", cnt);
432 case SOLVER_TRANSACTION_CHANGED:
433 POOL_DEBUG(SAT_DEBUG_RESULT, "changed packages (%d):\n", cnt);
435 case SOLVER_TRANSACTION_UPGRADED:
436 POOL_DEBUG(SAT_DEBUG_RESULT, "upgraded packages (%d):\n", cnt);
438 case SOLVER_TRANSACTION_VENDORCHANGE:
439 POOL_DEBUG(SAT_DEBUG_RESULT, "vendor change from '%s' to '%s' (%d):\n", id2strnone(pool, classes.elements[i + 2]), id2strnone(pool, classes.elements[i + 3]), cnt);
441 case SOLVER_TRANSACTION_ARCHCHANGE:
442 POOL_DEBUG(SAT_DEBUG_RESULT, "arch change from %s to %s (%d):\n", id2str(pool, classes.elements[i + 2]), id2str(pool, classes.elements[i + 3]), cnt);
445 class = SOLVER_TRANSACTION_IGNORE;
448 if (class == SOLVER_TRANSACTION_IGNORE)
450 transaction_classify_pkgs(trans, mode, class, classes.elements[i + 2], classes.elements[i + 3], &pkgs);
453 for (j = 0; j < pkgs.count; j++)
455 Id p = pkgs.elements[j];
456 Solvable *s = pool->solvables + p;
461 case SOLVER_TRANSACTION_DOWNGRADED:
462 case SOLVER_TRANSACTION_UPGRADED:
463 s2 = pool->solvables + transaction_obs_pkg(trans, p);
464 POOL_DEBUG(SAT_DEBUG_RESULT, " - %s -> %s\n", solvable2str(pool, s), solvable2str(pool, s2));
466 case SOLVER_TRANSACTION_VENDORCHANGE:
467 case SOLVER_TRANSACTION_ARCHCHANGE:
468 n = id2str(pool, s->name);
470 if (l + linel > sizeof(line) - 3)
473 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", line);
477 if (l + linel > sizeof(line) - 3)
478 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", n);
483 strcpy(line + linel, ", ");
486 strcpy(line + linel, n);
491 POOL_DEBUG(SAT_DEBUG_RESULT, " - %s\n", solvable2str(pool, s));
496 POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", line);
497 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
499 queue_free(&classes);
504 solver_printprobleminfo(Solver *solv, Id problem)
506 Pool *pool = solv->pool;
508 Id dep, source, target;
510 probr = solver_findproblemrule(solv, problem);
511 switch (solver_ruleinfo(solv, probr, &source, &target, &dep))
513 case SOLVER_RULE_DISTUPGRADE:
514 POOL_DEBUG(SAT_DEBUG_RESULT, "%s does not belong to a distupgrade repository\n", solvid2str(pool, source));
516 case SOLVER_RULE_INFARCH:
517 POOL_DEBUG(SAT_DEBUG_RESULT, "%s has inferior architecture\n", solvid2str(pool, source));
519 case SOLVER_RULE_UPDATE:
520 POOL_DEBUG(SAT_DEBUG_RESULT, "problem with installed package %s\n", solvid2str(pool, source));
522 case SOLVER_RULE_JOB:
523 POOL_DEBUG(SAT_DEBUG_RESULT, "conflicting requests\n");
525 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
526 POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides requested %s\n", dep2str(pool, dep));
528 case SOLVER_RULE_RPM:
529 POOL_DEBUG(SAT_DEBUG_RESULT, "some dependency problem\n");
531 case SOLVER_RULE_RPM_NOT_INSTALLABLE:
532 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s is not installable\n", solvid2str(pool, source));
534 case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
535 POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides %s needed by %s\n", dep2str(pool, dep), solvid2str(pool, source));
537 case SOLVER_RULE_RPM_SAME_NAME:
538 POOL_DEBUG(SAT_DEBUG_RESULT, "cannot install both %s and %s\n", solvid2str(pool, source), solvid2str(pool, target));
540 case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
541 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
543 case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
544 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
546 case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
547 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s implicitely obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
549 case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
550 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", solvid2str(pool, source), dep2str(pool, dep));
552 case SOLVER_RULE_RPM_SELF_CONFLICT:
553 POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", solvid2str(pool, source), dep2str(pool, dep));
555 case SOLVER_RULE_UNKNOWN:
556 case SOLVER_RULE_FEATURE:
557 case SOLVER_RULE_LEARNT:
558 POOL_DEBUG(SAT_DEBUG_RESULT, "bad rule type\n");
564 solver_printsolution(Solver *solv, Id problem, Id solution)
566 Pool *pool = solv->pool;
567 Id p, rp, element, how, what, select;
571 while ((element = solver_next_solutionelement(solv, problem, solution, element, &p, &rp)) != 0)
573 if (p == SOLVER_SOLUTION_JOB)
575 /* job, rp is index into job queue */
576 how = solv->job.elements[rp - 1];
577 what = solv->job.elements[rp];
578 select = how & SOLVER_SELECTMASK;
579 switch (how & SOLVER_JOBMASK)
582 if (select == SOLVER_SOLVABLE && solv->installed && pool->solvables[what].repo == solv->installed)
583 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not keep %s installed\n", solvid2str(pool, what));
584 else if (select == SOLVER_SOLVABLE_PROVIDES)
585 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install a solvable %s\n", solver_select2str(solv, select, what));
587 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install %s\n", solver_select2str(solv, select, what));
590 if (select == SOLVER_SOLVABLE && !(solv->installed && pool->solvables[what].repo == solv->installed))
591 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not forbid installation of %s\n", solvid2str(pool, what));
592 else if (select == SOLVER_SOLVABLE_PROVIDES)
593 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not deinstall all solvables %s\n", solver_select2str(solv, select, what));
595 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not deinstall %s\n", solver_select2str(solv, select, what));
598 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install most recent version of %s\n", solver_select2str(solv, select, what));
601 POOL_DEBUG(SAT_DEBUG_RESULT, " - do not lock %s\n", solver_select2str(solv, select, what));
604 POOL_DEBUG(SAT_DEBUG_RESULT, " - do something different\n");
608 else if (p == SOLVER_SOLUTION_INFARCH)
610 s = pool->solvables + rp;
611 if (solv->installed && s->repo == solv->installed)
612 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep %s despite the inferior architecture\n", solvable2str(pool, s));
614 POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s despite the inferior architecture\n", solvable2str(pool, s));
616 else if (p == SOLVER_SOLUTION_DISTUPGRADE)
618 s = pool->solvables + rp;
619 if (solv->installed && s->repo == solv->installed)
620 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", solvable2str(pool, s));
622 POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s from excluded repository\n", solvable2str(pool, s));
626 /* policy, replace p with rp */
627 s = pool->solvables + p;
628 sd = rp ? pool->solvables + rp : 0;
629 if (s == sd && solv->distupgrade)
631 POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", solvable2str(pool, s));
636 if (!solv->allowdowngrade && evrcmp(pool, s->evr, sd->evr, EVRCMP_MATCH_RELEASE) > 0)
638 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow downgrade of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
641 if (!solv->allowarchchange && s->name == sd->name && s->arch != sd->arch && policy_illegal_archchange(solv, s, sd))
643 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow architecture change of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
646 if (!solv->allowvendorchange && s->name == sd->name && s->vendor != sd->vendor && policy_illegal_vendorchange(solv, s, sd))
649 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));
651 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));
655 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow replacement of %s with %s\n", solvable2str(pool, s), solvable2str(pool, sd));
659 POOL_DEBUG(SAT_DEBUG_RESULT, " - allow deinstallation of %s\n", solvable2str(pool, s));
667 solver_printallsolutions(Solver *solv)
669 Pool *pool = solv->pool;
671 Id problem, solution;
673 POOL_DEBUG(SAT_DEBUG_RESULT, "Encountered problems! Here are the solutions:\n\n");
676 while ((problem = solver_next_problem(solv, problem)) != 0)
679 POOL_DEBUG(SAT_DEBUG_RESULT, "Problem %d:\n", pcnt);
680 POOL_DEBUG(SAT_DEBUG_RESULT, "====================================\n");
681 solver_printprobleminfo(solv, problem);
682 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
684 while ((solution = solver_next_solution(solv, problem, solution)) != 0)
686 solver_printsolution(solv, problem, solution);
687 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
693 solver_printtrivial(Solver *solv)
695 Pool *pool = solv->pool;
703 for (p = 1, s = pool->solvables + p; p < solv->pool->nsolvables; p++, s++)
705 n = id2str(pool, s->name);
706 if (strncmp(n, "patch:", 6) != 0 && strncmp(n, "pattern:", 8) != 0)
716 solver_trivial_installable(solv, &in, &out);
717 POOL_DEBUG(SAT_DEBUG_RESULT, "trivial installable status:\n");
718 for (i = 0; i < in.count; i++)
719 POOL_DEBUG(SAT_DEBUG_RESULT, " %s: %d\n", solvid2str(pool, in.elements[i]), out.elements[i]);
720 POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
726 solver_select2str(Solver *solv, Id select, Id what)
728 Pool *pool = solv->pool;
731 if (select == SOLVER_SOLVABLE)
732 return solvid2str(pool, what);
733 if (select == SOLVER_SOLVABLE_NAME)
734 return dep2str(pool, what);
735 if (select == SOLVER_SOLVABLE_PROVIDES)
737 s = dep2str(pool, what);
738 b = pool_alloctmpspace(pool, 11 + strlen(s));
739 sprintf(b, "providing %s", s);
742 if (select == SOLVER_SOLVABLE_ONE_OF)
747 while ((p = pool->whatprovidesdata[what++]) != 0)
749 s = solvid2str(pool, p);
750 b2 = pool_alloctmpspace(pool, strlen(b) + strlen(s) + 3);
751 sprintf(b2, "%s, %s", b, s);
754 return *b ? b + 2 : "nothing";
756 return "unknown job select";