From dde0c674e423e5f06d1e319e3a096054607a5f72 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 20 Mar 2011 19:52:53 +0100 Subject: reorganize the marker methods a bit by moving the common part to a seperate IsModeChangeOk which checks sanity and dpkg holds --- 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 b95681118..8cf7db80a 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -486,6 +486,10 @@ class pkgDepCache : protected pkgCache::Namespace __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set &recheck) { return true; }; __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck) { return true; }; __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck) { return true; }; + + + bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, + unsigned long const Depth, bool const FromUser); }; #endif -- cgit v1.2.3 From cc26da01ef43686d67959ef080e5492410d20e4e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 26 Mar 2011 12:41:51 +0100 Subject: do not change protected packages in autoinstall (Closes: #618848) --- apt-pkg/depcache.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.h') diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 8cf7db80a..750da3d6f 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -119,7 +119,7 @@ class pkgDepCache : protected pkgCache::Namespace DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)}; // These flags are used in StateCache::iFlags - enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1), ReInstall = (1 << 2)}; + enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1), ReInstall = (1 << 2), Protected = (1 << 3)}; enum VersionTypes {NowVersion, InstallVersion, CandidateVersion}; enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2}; @@ -393,6 +393,7 @@ class pkgDepCache : protected pkgCache::Namespace void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true, unsigned long Depth = 0, bool FromUser = true, bool ForceImportantDeps = false); + void MarkProtected(PkgIterator const &Pkg) { PkgState[Pkg->ID].iFlags |= Protected; }; void SetReInstall(PkgIterator const &Pkg,bool To); // FIXME: Remove the unused boolean parameter on abi break -- cgit v1.2.3