From 2f5aab4afaa61ec9b9c690dea4a0b7d650bb2374 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 5 Sep 2024 14:58:50 +0200 Subject: Return an error if ResolveByKeep() is unsuccessful In case of held packages or packages that otherwise can't be kept back, we should return an error and not require the client to check the broken_count after calling us. LP: #2078720 --- apt-pkg/algorithms.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 6131ecd11..72184748a 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1423,6 +1423,9 @@ bool pkgProblemResolver::ResolveByKeepInternal() delete[] PList; + if (Cache.BrokenCount() != 0) + return _error->Error(_("Unable to correct problems, you have held broken packages.")); + if (Debug) Cache.CheckConsistency("keep done"); -- cgit v1.2.3-70-g09d2