From f93a5aa2daa92255c75865b6f92dddb4b072ff33 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 26 Sep 2022 12:33:55 +0200 Subject: Check state of dependency, not dependee in dependency keep back When iterating over I's dependencies (which are called Pkg), we accidentally checked if I was Protected() instead of Pkg when deciding whether Pkg can be kept back. LP: #1990684 --- apt-pkg/algorithms.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/algorithms.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 09fd78329..26d8c71c2 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1359,8 +1359,8 @@ bool pkgProblemResolver::ResolveByKeepInternal() if (Cache[Pkg].InstallVer == 0 || Pkg->CurrentVer == 0) continue; - - if (not Cache[I].Protect()) + + if (not Cache[Pkg].Protect()) { if (Debug == true) clog << " Keeping Package " << Pkg.FullName(false) << " due to " << Start.DepType() << endl; -- cgit v1.2.3-70-g09d2