From: Michael Schroeder Date: Tue, 19 Aug 2025 15:31:01 +0000 (+0200) Subject: Make doshowproof a bit more readable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac6a1e10fedd7d5df03ff5436c1826102283f2d3;p=thirdparty%2Flibsolv.git Make doshowproof a bit more readable --- diff --git a/examples/solv/solv.c b/examples/solv/solv.c index 22395306..4e0c9228 100644 --- a/examples/solv/solv.c +++ b/examples/solv/solv.c @@ -159,11 +159,6 @@ doshowproof(Solver *solv, Id id, int flags, Queue *lq) printf("unsolvable: "); else printf("%s %s: ", v < 0 ? "conflicted" : "installed", pool_solvidset2str(pool, &qp)); - if (type == 0) - { - printf("%s\n", solver_reason2str(solv, reason)); - continue; - } if (type == SOLVER_RULE_LEARNT && lq) { for (j = 0; j < lq->count; j++) @@ -175,7 +170,10 @@ doshowproof(Solver *solv, Id id, int flags, Queue *lq) continue; } } - printf("%s\n", solver_decisioninfo2str(solv, bits, type, from, to, dep)); + if (type == 0) /* for SOLVER_REASON_PREMISE */ + printf("%s\n", solver_reason2str(solv, reason)); + else + printf("%s\n", solver_decisioninfo2str(solv, bits, type, from, to, dep)); } queue_free(&qp); queue_free(&q);