From: David Kalnischkies Date: Wed, 13 Apr 2016 14:24:12 +0000 (+0200) Subject: recheck Pre-Depends satisfaction in SmartConfigure X-Git-Tag: 1.2.11~5 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/c75e60ebb6bc7a578b57e7c4e01579798bae720b recheck Pre-Depends satisfaction in SmartConfigure Regression introduced in commit 590f1923121815b36ef889033c1c416a23cbe9a2 (2011!) causing apt to not check if Pre-Depends are satisfied before calling --configure. This managed to hide so perfectly well for years as Pre-Depends aren't that common, apt prefers upgrading these packages first and checks for satisfaction is already in SmartUnpack, so there is only a small window of oppertunity to break a pre-dependency relation (usually with an unpack). Verified by logchecking with two provided status files in the buglog. I would have liked to write a test, but I wasn't able to reach the needed complexity to get apt to fail – but the change is small and reasonable, so what could possible go wrong™, right? LP: #1569099 --- diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index d75980e5e..b4e803a6e 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -408,7 +408,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) pkgCache::DepIterator Start, End; D.GlobOr(Start,End); - if (End->Type != pkgCache::Dep::Depends) + if (End->Type != pkgCache::Dep::Depends && End->Type != pkgCache::Dep::PreDepends) continue; Bad = true; @@ -534,7 +534,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) Discard.GlobOr(Start,End); } - if (End->Type != pkgCache::Dep::Depends) + if (End->Type != pkgCache::Dep::Depends && End->Type != pkgCache::Dep::PreDepends) continue; Bad = true;