From 2ba86f95bfad4ec00a3b99b311d05c158162b25c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 23 May 2020 16:22:44 +0200 Subject: Allow pkgDepCache to be asked to check internal consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For speed reasons pkgDepCache initializes its state once and then has a battery of update calls you have to invoke in the right order to update the various states – all in the name of speed. In debug and/or simulation mode we can sacrifice this speed for a bit of extra checking though to verify that we haven't made some critical mistake like #961266. --- apt-pkg/depcache.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index ff1b37374..d9bb69a18 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -502,6 +502,8 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace pkgDepCache(pkgCache * const Cache,Policy * const Plcy = 0); virtual ~pkgDepCache(); + bool CheckConsistency(char const *const msgtag = ""); + protected: // methods call by IsInstallOk bool IsInstallOkMultiArchSameVersionSynced(PkgIterator const &Pkg, @@ -521,6 +523,8 @@ class APT_PUBLIC pkgDepCache : protected pkgCache::Namespace APT_HIDDEN bool MarkInstall_StateChange(PkgIterator const &Pkg, bool AutoInst, bool FromUser); APT_HIDDEN bool MarkInstall_DiscardInstall(PkgIterator const &Pkg); + + APT_HIDDEN void PerformDependencyPass(OpProgress * const Prog); }; #endif -- cgit v1.2.3-70-g09d2