- treat undecided packages as erase like libzypp does
[platform/upstream/libsolv.git] / src / solverdebug.c
1 /*
2  * Copyright (c) 2008, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * solverdebug.c
10  *
11  * debug functions for the SAT solver
12  */
13
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <unistd.h>
17 #include <string.h>
18 #include <assert.h>
19
20 #include "solver.h"
21 #include "solverdebug.h"
22 #include "bitmap.h"
23 #include "pool.h"
24 #include "util.h"
25 #include "evr.h"
26 #include "policy.h"
27
28
29 /*
30  * create obsoletesmap from solver decisions
31  *
32  * for solvables in installed repo:
33  *   0 - not obsoleted
34  *   p - one of the packages that obsolete us
35  * for all others:
36  *   n - number of packages this package obsoletes
37  *
38  */
39
40 Id *
41 solver_create_decisions_obsoletesmap(Solver *solv)
42 {
43   Pool *pool = solv->pool;
44   Repo *installed = solv->installed;
45   Id p, *obsoletesmap = NULL;
46   int i;
47   Solvable *s;
48
49   obsoletesmap = (Id *)sat_calloc(pool->nsolvables, sizeof(Id));
50   if (installed)
51     {
52       for (i = 0; i < solv->decisionq.count; i++)
53         {
54           Id pp, n;
55           int noobs;
56
57           n = solv->decisionq.elements[i];
58           if (n < 0)
59             continue;
60           if (n == SYSTEMSOLVABLE)
61             continue;
62           s = pool->solvables + n;
63           if (s->repo == installed)             /* obsoletes don't count for already installed packages */
64             continue;
65           noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n);
66           FOR_PROVIDES(p, pp, s->name)
67             {
68               Solvable *ps = pool->solvables + p;
69               if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
70                 continue;
71               if (!solv->implicitobsoleteusesprovides && s->name != ps->name)
72                 continue;
73               if (pool->solvables[p].repo == installed && !obsoletesmap[p])
74                 {
75                   obsoletesmap[p] = n;
76                   obsoletesmap[n]++;
77                 }
78             }
79         }
80       for (i = 0; i < solv->decisionq.count; i++)
81         {
82           Id obs, *obsp;
83           Id pp, n;
84
85           n = solv->decisionq.elements[i];
86           if (n < 0)
87             continue;
88           if (n == SYSTEMSOLVABLE)
89             continue;
90           s = pool->solvables + n;
91           if (s->repo == installed)             /* obsoletes don't count for already installed packages */
92             continue;
93           if (!s->obsoletes)
94             continue;
95           if (solv->noobsoletes.size && MAPTST(&solv->noobsoletes, n))
96             continue;
97           obsp = s->repo->idarraydata + s->obsoletes;
98           while ((obs = *obsp++) != 0)
99             {
100               FOR_PROVIDES(p, pp, obs)
101                 {
102                   if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
103                     continue;
104                   if (pool->solvables[p].repo == installed && !obsoletesmap[p])
105                     {
106                       obsoletesmap[p] = n;
107                       obsoletesmap[n]++;
108                     }
109                 }
110             }
111         }
112     }
113   return obsoletesmap;
114 }
115
116 void
117 solver_printruleelement(Solver *solv, int type, Rule *r, Id v)
118 {
119   Pool *pool = solv->pool;
120   Solvable *s;
121   if (v < 0)
122     {
123       s = pool->solvables + -v;
124       POOL_DEBUG(type, "    !%s [%d]", solvable2str(pool, s), -v);
125     }
126   else
127     {
128       s = pool->solvables + v;
129       POOL_DEBUG(type, "    %s [%d]", solvable2str(pool, s), v);
130     }
131   if (r)
132     {
133       if (r->w1 == v)
134         POOL_DEBUG(type, " (w1)");
135       if (r->w2 == v)
136         POOL_DEBUG(type, " (w2)");
137     }
138   if (solv->decisionmap[s - pool->solvables] > 0)
139     POOL_DEBUG(type, " Install.level%d", solv->decisionmap[s - pool->solvables]);
140   if (solv->decisionmap[s - pool->solvables] < 0)
141     POOL_DEBUG(type, " Conflict.level%d", -solv->decisionmap[s - pool->solvables]);
142   POOL_DEBUG(type, "\n");
143 }
144
145
146 /*
147  * print rule
148  */
149
150 void
151 solver_printrule(Solver *solv, int type, Rule *r)
152 {
153   Pool *pool = solv->pool;
154   int i;
155   Id d, v;
156
157   if (r >= solv->rules && r < solv->rules + solv->nrules)   /* r is a solver rule */
158     POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules));
159   else
160     POOL_DEBUG(type, "Rule:");                 /* r is any rule */
161   if (r && r->d < 0)
162     POOL_DEBUG(type, " (disabled)");
163   POOL_DEBUG(type, "\n");
164   d = r->d < 0 ? -r->d - 1 : r->d;
165   for (i = 0; ; i++)
166     {
167       if (i == 0)
168           /* print direct literal */
169         v = r->p;
170       else if (!d)
171         {
172           if (i == 2)
173             break;
174           /* binary rule --> print w2 as second literal */
175           v = r->w2;
176         }
177       else
178           /* every other which is in d */
179         v = solv->pool->whatprovidesdata[d + i - 1];
180       if (v == ID_NULL)
181         break;
182       solver_printruleelement(solv, type, r, v);
183     }
184   POOL_DEBUG(type, "    next rules: %d %d\n", r->n1, r->n2);
185 }
186
187 void
188 solver_printruleclass(Solver *solv, int type, Rule *r)
189 {
190   Pool *pool = solv->pool;
191   Id p = r - solv->rules;
192   assert(p >= 0);
193   if (p < solv->learntrules)
194     if (MAPTST(&solv->weakrulemap, p))
195       POOL_DEBUG(type, "WEAK ");
196   if (p >= solv->learntrules)
197     POOL_DEBUG(type, "LEARNT ");
198   else if (p >= solv->jobrules && p < solv->jobrules_end)
199     POOL_DEBUG(type, "JOB ");
200   else if (p >= solv->updaterules && p < solv->updaterules_end)
201     POOL_DEBUG(type, "UPDATE ");
202   else if (p >= solv->featurerules && p < solv->featurerules_end)
203     POOL_DEBUG(type, "FEATURE ");
204   solver_printrule(solv, type, r);
205 }
206
207 void
208 solver_printproblem(Solver *solv, Id v)
209 {
210   Pool *pool = solv->pool;
211   int i;
212   Rule *r;
213   Id *jp;
214
215   if (v > 0)
216     solver_printruleclass(solv, SAT_DEBUG_SOLUTIONS, solv->rules + v);
217   else
218     {
219       v = -(v + 1);
220       POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "JOB %d\n", v);
221       jp = solv->ruletojob.elements;
222       for (i = solv->jobrules, r = solv->rules + i; i < solv->learntrules; i++, r++, jp++)
223         if (*jp == v)
224           {
225             POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "- ");
226             solver_printrule(solv, SAT_DEBUG_SOLUTIONS, r);
227           }
228       POOL_DEBUG(SAT_DEBUG_SOLUTIONS, "ENDJOB\n");
229     }
230 }
231
232 void
233 solver_printwatches(Solver *solv, int type)
234 {
235   Pool *pool = solv->pool;
236   int counter;
237
238   POOL_DEBUG(type, "Watches: \n");
239   for (counter = -(pool->nsolvables - 1); counter < pool->nsolvables; counter++)
240     POOL_DEBUG(type, "    solvable [%d] -- rule [%d]\n", counter, solv->watches[counter + pool->nsolvables]);
241 }
242
243 /*
244  * printdecisions
245  */
246
247 void
248 solver_printdecisions(Solver *solv)
249 {
250   Pool *pool = solv->pool;
251   Repo *installed = solv->installed;
252   Id p, *obsoletesmap = solver_create_decisions_obsoletesmap(solv);
253   int i;
254   Solvable *s;
255
256   IF_POOLDEBUG (SAT_DEBUG_SCHUBI)
257     {
258       POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions -----\n");
259       for (i = 0; i < solv->decisionq.count; i++)
260         {
261           p = solv->decisionq.elements[i];
262           solver_printruleelement(solv, SAT_DEBUG_SCHUBI, 0, p);
263         }
264       POOL_DEBUG(SAT_DEBUG_SCHUBI, "----- Decisions end -----\n");
265     }
266
267   POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
268   POOL_DEBUG(SAT_DEBUG_RESULT, "transaction:\n");
269
270   /* print solvables to be erased */
271
272   if (installed)
273     {
274       FOR_REPO_SOLVABLES(installed, p, s)
275         {
276           if (solv->decisionmap[p] > 0)
277             continue;
278           if (obsoletesmap[p])
279             continue;
280           POOL_DEBUG(SAT_DEBUG_RESULT, "  erase     %s\n", solvable2str(pool, s));
281         }
282     }
283
284   /* print solvables to be installed */
285
286   for (i = 0; i < solv->decisionq.count; i++)
287     {
288       int j;
289       p = solv->decisionq.elements[i];
290       if (p < 0)
291         continue;
292       if (p == SYSTEMSOLVABLE)
293         continue;
294       s = pool->solvables + p;
295       if (installed && s->repo == installed)
296         continue;
297
298       if (!obsoletesmap[p])
299         {
300           POOL_DEBUG(SAT_DEBUG_RESULT, "  install   %s", solvable2str(pool, s));
301         }
302       else
303         {
304           Id xp, xpp;
305           FOR_PROVIDES(xp, xpp, s->name)
306             {
307               Solvable *s2 = pool->solvables + xp;
308               if (s2->name != s->name)
309                 continue;
310               if (evrcmp(pool, s->evr, s2->evr, EVRCMP_MATCH_RELEASE) < 0)
311                 break;
312             }
313           if (xp)
314             POOL_DEBUG(SAT_DEBUG_RESULT, "  downgrade %s", solvable2str(pool, s));
315           else
316             POOL_DEBUG(SAT_DEBUG_RESULT, "  upgrade   %s", solvable2str(pool, s));
317           POOL_DEBUG(SAT_DEBUG_RESULT, "  (obsoletes");
318           for (j = installed->start; j < installed->end; j++)
319             if (obsoletesmap[j] == p)
320               POOL_DEBUG(SAT_DEBUG_RESULT, " %s", solvable2str(pool, pool->solvables + j));
321           POOL_DEBUG(SAT_DEBUG_RESULT, ")");
322         }
323       POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
324     }
325   POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
326
327   sat_free(obsoletesmap);
328
329   if (solv->recommendations.count)
330     {
331       POOL_DEBUG(SAT_DEBUG_RESULT, "recommended packages:\n");
332       for (i = 0; i < solv->recommendations.count; i++)
333         {
334           s = pool->solvables + solv->recommendations.elements[i];
335           if (solv->decisionmap[solv->recommendations.elements[i]] > 0)
336             {
337               if (installed && s->repo == installed)
338                 POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (installed)\n", solvable2str(pool, s));
339               else
340                 POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (selected)\n", solvable2str(pool, s));
341             }
342           else
343             POOL_DEBUG(SAT_DEBUG_RESULT, "  %s\n", solvable2str(pool, s));
344         }
345       POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
346     }
347
348   if (solv->suggestions.count)
349     {
350       POOL_DEBUG(SAT_DEBUG_RESULT, "suggested packages:\n");
351       for (i = 0; i < solv->suggestions.count; i++)
352         {
353           s = pool->solvables + solv->suggestions.elements[i];
354           if (solv->decisionmap[solv->suggestions.elements[i]] > 0)
355             {
356               if (installed && s->repo == installed)
357                 POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (installed)\n", solvable2str(pool, s));
358               else
359                 POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (selected)\n", solvable2str(pool, s));
360             }
361           else
362             POOL_DEBUG(SAT_DEBUG_RESULT, "  %s\n", solvable2str(pool, s));
363         }
364       POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
365     }
366   if (solv->orphaned.count)
367     {
368       POOL_DEBUG(SAT_DEBUG_RESULT, "orphaned packages:\n");
369       for (i = 0; i < solv->orphaned.count; i++)
370         {
371           s = pool->solvables + solv->orphaned.elements[i];
372           if (solv->decisionmap[solv->orphaned.elements[i]] > 0)
373             POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (kept)\n", solvable2str(pool, s));
374           else
375             POOL_DEBUG(SAT_DEBUG_RESULT, "  %s (erased)\n", solvable2str(pool, s));
376         }
377       POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
378     }
379 }
380
381 void
382 solver_printprobleminfo(Solver *solv, Queue *job, Id problem)
383 {
384   Pool *pool = solv->pool;
385   Id probr;
386   Id dep, source, target;
387   Solvable *s, *s2;
388
389   probr = solver_findproblemrule(solv, problem);
390   switch (solver_problemruleinfo(solv, job, probr, &dep, &source, &target))
391     {
392     case SOLVER_PROBLEM_UPDATE_RULE:
393       s = pool_id2solvable(pool, source);
394       POOL_DEBUG(SAT_DEBUG_RESULT, "problem with installed package %s\n", solvable2str(pool, s));
395       return;
396     case SOLVER_PROBLEM_JOB_RULE:
397       POOL_DEBUG(SAT_DEBUG_RESULT, "conflicting requests\n");
398       return;
399     case SOLVER_PROBLEM_RPM_RULE:
400       POOL_DEBUG(SAT_DEBUG_RESULT, "some dependency problem\n");
401       return;
402     case SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP:
403       POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides requested %s\n", dep2str(pool, dep));
404       return;
405     case SOLVER_PROBLEM_NOT_INSTALLABLE:
406       s = pool_id2solvable(pool, source);
407       POOL_DEBUG(SAT_DEBUG_RESULT, "package %s is not installable\n", solvable2str(pool, s));
408       return;
409     case SOLVER_PROBLEM_NOTHING_PROVIDES_DEP:
410       s = pool_id2solvable(pool, source);
411       POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides %s needed by %s\n", dep2str(pool, dep), solvable2str(pool, s));
412       return;
413     case SOLVER_PROBLEM_SAME_NAME:
414       s = pool_id2solvable(pool, source);
415       s2 = pool_id2solvable(pool, target);
416       POOL_DEBUG(SAT_DEBUG_RESULT, "cannot install both %s and %s\n", solvable2str(pool, s), solvable2str(pool, s2));
417       return;
418     case SOLVER_PROBLEM_PACKAGE_CONFLICT:
419       s = pool_id2solvable(pool, source);
420       s2 = pool_id2solvable(pool, target);
421       POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by %s\n", solvable2str(pool, s), dep2str(pool, dep), solvable2str(pool, s2));
422       return;
423     case SOLVER_PROBLEM_PACKAGE_OBSOLETES:
424       s = pool_id2solvable(pool, source);
425       s2 = pool_id2solvable(pool, target);
426       POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", solvable2str(pool, s), dep2str(pool, dep), solvable2str(pool, s2));
427       return;
428     case SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE:
429       s = pool_id2solvable(pool, source);
430       POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", solvable2str(pool, s), dep2str(pool, dep));
431       return;
432     case SOLVER_PROBLEM_SELF_CONFLICT:
433       s = pool_id2solvable(pool, source);
434       POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", solvable2str(pool, s), dep2str(pool, dep));
435       return;
436     }
437 }
438
439 void
440 solver_printsolutions(Solver *solv, Queue *job)
441 {
442   Pool *pool = solv->pool;
443   int pcnt;
444   Id p, rp, how, what, select;
445   Id problem, solution, element;
446   Solvable *s, *sd;
447
448   POOL_DEBUG(SAT_DEBUG_RESULT, "Encountered problems! Here are the solutions:\n\n");
449   pcnt = 1;
450   problem = 0;
451   while ((problem = solver_next_problem(solv, problem)) != 0)
452     {
453       POOL_DEBUG(SAT_DEBUG_RESULT, "Problem %d:\n", pcnt++);
454       POOL_DEBUG(SAT_DEBUG_RESULT, "====================================\n");
455       solver_printprobleminfo(solv, job, problem);
456       POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
457       solution = 0;
458       while ((solution = solver_next_solution(solv, problem, solution)) != 0)
459         {
460           element = 0;
461           while ((element = solver_next_solutionelement(solv, problem, solution, element, &p, &rp)) != 0)
462             {
463               if (p == 0)
464                 {
465                   /* job, rp is index into job queue */
466                   how = job->elements[rp - 1];
467                   what = job->elements[rp];
468                   select = how & SOLVER_SELECTMASK;
469                   switch (how & SOLVER_JOBMASK)
470                     {
471                     case SOLVER_INSTALL:
472                       if (select == SOLVER_SOLVABLE && solv->installed && pool->solvables[what].repo == solv->installed)
473                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not keep %s installed\n", solvable2str(pool, pool->solvables + what));
474                       else if (select == SOLVER_SOLVABLE_PROVIDES)
475                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not install a solvable %s\n", solver_select2str(solv, select, what));
476                       else
477                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not install %s\n", solver_select2str(solv, select, what));
478                       break;
479                     case SOLVER_ERASE:
480                       if (select == SOLVER_SOLVABLE && !(solv->installed && pool->solvables[what].repo == solv->installed))
481                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not forbid installation of %s\n", solvable2str(pool, pool->solvables + what));
482                       else if (select == SOLVER_SOLVABLE_PROVIDES)
483                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not deinstall all solvables %s\n", solver_select2str(solv, select, what));
484                       else
485                         POOL_DEBUG(SAT_DEBUG_RESULT, "- do not deinstall %s\n", solver_select2str(solv, select, what));
486                       break;
487                     case SOLVER_UPDATE:
488                       POOL_DEBUG(SAT_DEBUG_RESULT, "- do not install most recent version of %s\n", solver_select2str(solv, select, what));
489                       break;
490                     case SOLVER_LOCK:
491                       POOL_DEBUG(SAT_DEBUG_RESULT, "- do not lock %s\n", solver_select2str(solv, select, what));
492                       break;
493                     default:
494                       POOL_DEBUG(SAT_DEBUG_RESULT, "- do something different\n");
495                       break;
496                     }
497                 }
498               else
499                 {
500                   /* policy, replace p with rp */
501                   s = pool->solvables + p;
502                   sd = rp ? pool->solvables + rp : 0;
503                   if (s == sd && solv->distupgrade)
504                     {
505                       POOL_DEBUG(SAT_DEBUG_RESULT, "- keep obsolete %s\n", solvable2str(pool, s));
506                     }
507                   else if (sd)
508                     {
509                       int gotone = 0;
510                       if (!solv->allowdowngrade && evrcmp(pool, s->evr, sd->evr, EVRCMP_MATCH_RELEASE) > 0)
511                         {
512                           POOL_DEBUG(SAT_DEBUG_RESULT, "- allow downgrade of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
513                           gotone = 1;
514                         }
515                       if (!solv->allowarchchange && s->name == sd->name && s->arch != sd->arch && policy_illegal_archchange(solv, s, sd))
516                         {
517                           POOL_DEBUG(SAT_DEBUG_RESULT, "- allow architecture change of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
518                           gotone = 1;
519                         }
520                       if (!solv->allowvendorchange && s->name == sd->name && s->vendor != sd->vendor && policy_illegal_vendorchange(solv, s, sd))
521                         {
522                           if (sd->vendor)
523                             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));
524                           else
525                             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));
526                           gotone = 1;
527                         }
528                       if (!gotone)
529                         POOL_DEBUG(SAT_DEBUG_RESULT, "- allow replacement of %s with %s\n", solvable2str(pool, s), solvable2str(pool, sd));
530                     }
531                   else
532                     {
533                       POOL_DEBUG(SAT_DEBUG_RESULT, "- allow deinstallation of %s\n", solvable2str(pool, s));
534                     }
535
536                 }
537             }
538           POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
539         }
540     }
541 }
542
543 void
544 solver_printtrivial(Solver *solv)
545 {
546   Pool *pool = solv->pool;
547   Queue in, out;
548   Map installedmap;
549   Id p;
550   const char *n; 
551   Solvable *s; 
552   int i;
553
554   queue_init(&in);
555   for (p = 1, s = pool->solvables + p; p < solv->pool->nsolvables; p++, s++)
556     {   
557       n = id2str(pool, s->name);
558       if (strncmp(n, "patch:", 6) != 0 && strncmp(n, "pattern:", 8) != 0)
559         continue;
560       queue_push(&in, p); 
561     }   
562   if (!in.count)
563     {
564       queue_free(&in);
565       return;
566     }
567   solver_create_state_maps(solv, &installedmap, 0); 
568   queue_init(&out);
569   pool_trivial_installable(pool, &installedmap, &in, &out);
570   POOL_DEBUG(SAT_DEBUG_RESULT, "trivial installable status:\n");
571   for (i = 0; i < in.count; i++)
572     POOL_DEBUG(SAT_DEBUG_RESULT, "  %s: %d\n", solvable2str(pool, pool->solvables + in.elements[i]), out.elements[i]);
573   POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
574   map_free(&installedmap);
575   queue_free(&in);
576   queue_free(&out);
577 }
578
579 const char *
580 solver_select2str(Solver *solv, Id select, Id what)
581 {
582   Pool *pool = solv->pool;
583   const char *s;
584   char *b;
585   if (select == SOLVER_SOLVABLE)
586     return solvable2str(pool, pool->solvables + what);
587   if (select == SOLVER_SOLVABLE_NAME)
588     return dep2str(pool, what);
589   if (select == SOLVER_SOLVABLE_PROVIDES)
590     {
591       s = dep2str(pool, what);
592       b = pool_alloctmpspace(pool, 11 + strlen(s));
593       sprintf(b, "providing %s", s);
594       return b;
595     }
596   if (select == SOLVER_SOLVABLE_ONE_OF)
597     {
598       Id p;
599       char *b2;
600       b = "";
601       while ((p = pool->whatprovidesdata[what++]) != 0)
602         {
603           s = solvable2str(pool, pool->solvables + p);
604           b2 = pool_alloctmpspace(pool, strlen(b) + strlen(s) + 3);
605           sprintf(b2, "%s, %s", b, s);
606           b = b2;
607         }
608       return *b ? b + 2 : "nothing";
609     }
610   return "unknown job select";
611 }