]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Make doshowproof a bit more readable
authorMichael Schroeder <mls@suse.de>
Tue, 19 Aug 2025 15:31:01 +0000 (17:31 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 3 Feb 2026 12:04:27 +0000 (13:04 +0100)
examples/solv/solv.c

index 223953067745bb83daf223418d34747b81de0f15..4e0c92287b666c80d4bb18496f4fd826f8fa49d9 100644 (file)
@@ -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);