summaryrefslogtreecommitdiff
path: root/apt-pkg/solver3.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-12-28 21:42:32 +0100
committerJulian Andres Klode <jak@debian.org>2026-01-05 21:20:24 +0000
commitd0643f993d3c6c42ea10d5ce3a02d964b7693a7f (patch)
treef162b726b58fb336ae2f251a30ba1c4a87417cd9 /apt-pkg/solver3.cc
parentee82f420e7a303b5d92302134401e465b386de94 (diff)
solver3: Re-use existing error message code in Solve()
We can just re-use Enqueue() here to produce our conflict message why am I being silly and duplicate this.
Diffstat (limited to 'apt-pkg/solver3.cc')
-rw-r--r--apt-pkg/solver3.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc
index eb142435b..54f31a797 100644
--- a/apt-pkg/solver3.cc
+++ b/apt-pkg/solver3.cc
@@ -623,13 +623,10 @@ bool Solver::Solve()
}
if (not foundSolution && not item.clause->optional)
{
- std::ostringstream err;
-
- err << "Unable to satisfy dependencies. Reached two conflicting assignments:" << "\n";
- std::unordered_set<Var> seen;
- err << "1. " << LongWhyStr(item.clause->reason, true, (*this)[item.clause->reason].reason, " ", seen).substr(3) << "\n";
- err << "2. " << LongWhyStr(item.clause->reason, false, item.clause, " ", seen).substr(3);
- _error->Error("%s", err.str().c_str());
+ // Enqueue produces the right error message for us here, given that reason has been assigned true already...
+ assert(value(item.clause->reason) == LiftedBool::True);
+ bool res = Enqueue(~item.clause->reason, item.clause);
+ assert(not res);
if (not Pop())
return false;
}