7 #include "solverdebug.h"
9 #include "repo_rpmdb.h"
10 #include "pool_fileconflicts.h"
13 iterate_handle(Pool *pool, Id p, void *cbdata)
15 Solvable *s = pool->solvables + p;
20 rpm_byrpmdbid(0, 0, (void **)cbdata);
23 if (!s->repo->rpmdbid)
25 rpmdbid = s->repo->rpmdbid[p - s->repo->start];
28 return rpm_byrpmdbid(rpmdbid, 0, (void **)cbdata);
38 Queue todo, conflicts;
42 pool_setdebuglevel(pool, 1);
43 installed = repo_create(pool, "@System");
44 pool_set_installed(pool, installed);
45 repo_add_rpmdb(installed, 0, 0, 0);
47 queue_init(&conflicts);
48 FOR_REPO_SOLVABLES(installed, p, s)
50 pool_findfileconflicts(pool, &todo, 0, &conflicts, &iterate_handle, (void *)&state);
52 for (i = 0; i < conflicts.count; i += 5)
53 printf("%s: %s[%s] %s[%s]\n", pool_id2str(pool, conflicts.elements[i]), pool_solvid2str(pool, conflicts.elements[i + 1]), pool_id2str(pool, conflicts.elements[i + 2]), pool_solvid2str(pool, conflicts.elements[i + 3]), pool_id2str(pool, conflicts.elements[i + 4]));
60 pool_add_fileconflicts_deps(pool, &conflicts);
61 pool_addfileprovides(pool);
62 pool_createwhatprovides(pool);
63 pool_setdebuglevel(pool, 0);
64 Solver *solv = solver_create(pool);
65 queue_push2(&job, SOLVER_VERIFY|SOLVER_SOLVABLE_ALL, 0);
67 solv->allowuninstall = 1;
69 problemcnt = solver_solve(solv, &job);
71 solver_printallsolutions(solv);
73 solver_printtransaction(solv);
77 queue_free(&conflicts);