]> git.saurik.com Git - apt.git/commitdiff
recheck Pre-Depends satisfaction in SmartConfigure
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 13 Apr 2016 14:24:12 +0000 (16:24 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 13 Apr 2016 19:33:32 +0000 (21:33 +0200)
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

apt-pkg/packagemanager.cc

index d75980e5eb5785cbc487f8450befa4917f2edd53..b4e803a6e2ba8e059826b4260a8f347ce3535a45 100644 (file)
@@ -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;