summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/depcache.h')
-rw-r--r--apt-pkg/depcache.h49
1 files changed, 26 insertions, 23 deletions
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 760f0b589..f6e6c0afc 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -40,12 +40,13 @@
#include <apt-pkg/configuration.h>
#include <apt-pkg/pkgcache.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/error.h>
#include <vector>
#include <memory>
#include <set>
+#include <list>
+
+class OpProgress;
class pkgDepCache : protected pkgCache::Namespace
{
@@ -233,6 +234,7 @@ class pkgDepCache : protected pkgCache::Namespace
inline bool Delete() const {return Mode == ModeDelete;};
inline bool Purge() const {return Delete() == true && (iFlags & pkgDepCache::Purge) == pkgDepCache::Purge; };
inline bool Keep() const {return Mode == ModeKeep;};
+ inline bool Protect() const {return (iFlags & Protected) == Protected;};
inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;};
inline bool Upgradable() const {return Status >= 1;};
inline bool Downgrade() const {return Status < 0 && Mode == ModeInstall;};
@@ -257,11 +259,21 @@ class pkgDepCache : protected pkgCache::Namespace
class Policy
{
public:
-
+ Policy() {
+ InstallRecommends = _config->FindB("APT::Install-Recommends", false);
+ InstallSuggests = _config->FindB("APT::Install-Suggests", false);
+ }
+
virtual VerIterator GetCandidateVer(PkgIterator const &Pkg);
virtual bool IsImportantDep(DepIterator const &Dep);
-
+ virtual signed short GetPriority(PkgIterator const &Pkg);
+ virtual signed short GetPriority(PkgFileIterator const &File);
+
virtual ~Policy() {};
+
+ private:
+ bool InstallRecommends;
+ bool InstallSuggests;
};
private:
@@ -315,11 +327,10 @@ class pkgDepCache : protected pkgCache::Namespace
void Update(PkgIterator const &P);
// Count manipulators
- void AddSizes(const PkgIterator &Pkg, bool const &Invert = false);
+ void AddSizes(const PkgIterator &Pkg, bool const Invert = false);
inline void RemoveSizes(const PkgIterator &Pkg) {AddSizes(Pkg, true);};
- void AddSizes(const PkgIterator &Pkg,signed long Mult) __deprecated;
- void AddStates(const PkgIterator &Pkg,int Add = 1);
- inline void RemoveStates(const PkgIterator &Pkg) {AddStates(Pkg,-1);};
+ void AddStates(const PkgIterator &Pkg, bool const Invert = false);
+ inline void RemoveStates(const PkgIterator &Pkg) {AddStates(Pkg,true);};
public:
@@ -328,9 +339,9 @@ class pkgDepCache : protected pkgCache::Namespace
inline Header &Head() {return *Cache->HeaderP;};
inline GrpIterator GrpBegin() {return Cache->GrpBegin();};
inline PkgIterator PkgBegin() {return Cache->PkgBegin();};
- inline GrpIterator FindGrp(string const &Name) {return Cache->FindGrp(Name);};
- inline PkgIterator FindPkg(string const &Name) {return Cache->FindPkg(Name);};
- inline PkgIterator FindPkg(string const &Name, string const &Arch) {return Cache->FindPkg(Name, Arch);};
+ inline GrpIterator FindGrp(std::string const &Name) {return Cache->FindGrp(Name);};
+ inline PkgIterator FindPkg(std::string const &Name) {return Cache->FindPkg(Name);};
+ inline PkgIterator FindPkg(std::string const &Name, std::string const &Arch) {return Cache->FindPkg(Name, Arch);};
inline pkgCache &GetCache() {return *Cache;};
inline pkgVersioningSystem &VS() {return *Cache->VS;};
@@ -388,18 +399,17 @@ class pkgDepCache : protected pkgCache::Namespace
/** \name State Manipulators
*/
// @{
- void MarkKeep(PkgIterator const &Pkg, bool Soft = false,
+ bool MarkKeep(PkgIterator const &Pkg, bool Soft = false,
bool FromUser = true, unsigned long Depth = 0);
- void MarkDelete(PkgIterator const &Pkg, bool MarkPurge = false,
+ bool MarkDelete(PkgIterator const &Pkg, bool MarkPurge = false,
unsigned long Depth = 0, bool FromUser = true);
- void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true,
+ bool 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
- void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true);
+ void SetCandidateVersion(VerIterator TargetVer);
bool SetCandidateRelease(pkgCache::VerIterator TargetVer,
std::string const &TargetRel);
/** Set the candidate version for dependencies too if needed.
@@ -484,13 +494,6 @@ class pkgDepCache : protected pkgCache::Namespace
virtual ~pkgDepCache();
private:
- // Helper for Update(OpProgress) to remove pseudoinstalled arch all packages
- // FIXME: they are private so shouldn't affect abi, but just in caseā€¦
- __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set<unsigned long> &recheck) { return true; };
- __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set<unsigned long> &recheck) { return true; };
- __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set<unsigned long> &recheck) { return true; };
-
-
bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
unsigned long const Depth, bool const FromUser);
};