X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/094a497dd2dba1f47157e07d57f97c338a5ddaa0..2800688553a05fdac9fa732fc0af0d5318aee122:/apt-pkg/depcache.h diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 6cb8c1187..6ce204e65 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: depcache.h,v 1.3 1998/07/12 23:58:25 jgg Exp $ +// $Id: depcache.h,v 1.12 1999/10/22 05:58:54 jgg Exp $ /* ###################################################################### DepCache - Dependency Extension data for the cache @@ -44,6 +44,7 @@ #endif #include +#include class pkgDepCache : public pkgCache { @@ -59,7 +60,7 @@ class pkgDepCache : public pkgCache DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)}; // These flags are used in StateCache::iFlags - enum InternalFlags {AutoKept = (1 << 0)}; + enum InternalFlags {AutoKept = (1 << 0), Purge = (1 << 1), ReInstall = (1 << 2)}; enum VersionTypes {NowVersion, InstallVersion, CandidateVersion}; enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2}; @@ -93,7 +94,7 @@ class pkgDepCache : public pkgCache inline bool Delete() const {return Mode == ModeDelete;}; inline bool Keep() const {return Mode == ModeKeep;}; inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;}; - inline bool Upgradable() const {return Status == 1;}; + inline bool Upgradable() const {return Status >= 1;}; inline bool Downgrade() const {return Status < 0;}; inline bool Held() const {return Status != 0 && Keep();}; inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;}; @@ -109,7 +110,7 @@ class pkgDepCache : public pkgCache void BuildGroupOrs(VerIterator const &V); void UpdateVerState(PkgIterator Pkg); - bool Init(); + bool Init(OpProgress *Prog); protected: @@ -117,13 +118,13 @@ class pkgDepCache : public pkgCache StateCache *PkgState; unsigned char *DepState; - long iUsrSize; - long iDownloadSize; - long iInstCount; - long iDelCount; - long iKeepCount; - long iBrokenCount; - long iBadCount; + signed long iUsrSize; + unsigned long iDownloadSize; + unsigned long iInstCount; + unsigned long iDelCount; + unsigned long iKeepCount; + unsigned long iBrokenCount; + unsigned long iBadCount; // Check for a matching provides bool CheckDep(DepIterator Dep,int Type,PkgIterator &Res); @@ -152,7 +153,7 @@ class pkgDepCache : public pkgCache public: // Policy implementation - virtual VerIterator GetCandidateVer(PkgIterator Pkg); + virtual VerIterator GetCandidateVer(PkgIterator Pkg,bool AllowCurrent = true); virtual bool IsImportantDep(DepIterator Dep); // Accessors @@ -161,24 +162,23 @@ class pkgDepCache : public pkgCache // Manipulators void MarkKeep(PkgIterator const &Pkg,bool Soft = false); - void MarkDelete(PkgIterator const &Pkg); + void MarkDelete(PkgIterator const &Pkg,bool Purge = false); void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true); + void SetReInstall(PkgIterator const &Pkg,bool To); // This is for debuging - void Update(); - - // Hook to keep the extra data in sync - virtual bool ReMap(); + void Update(OpProgress *Prog = 0); // Size queries - inline long UsrSize() {return iUsrSize;}; - inline long DebSize() {return iDownloadSize;}; - inline long DelCount() {return iDelCount;}; - inline long KeepCount() {return iKeepCount;}; - inline long InstCount() {return iInstCount;}; - inline long BrokenCount() {return iBrokenCount;}; - inline long BadCount() {return iBadCount;}; + inline signed long UsrSize() {return iUsrSize;}; + inline unsigned long DebSize() {return iDownloadSize;}; + inline unsigned long DelCount() {return iDelCount;}; + inline unsigned long KeepCount() {return iKeepCount;}; + inline unsigned long InstCount() {return iInstCount;}; + inline unsigned long BrokenCount() {return iBrokenCount;}; + inline unsigned long BadCount() {return iBadCount;}; + pkgDepCache(MMap &Map,OpProgress &Prog); pkgDepCache(MMap &Map); virtual ~pkgDepCache(); };