// -*- 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
#endif
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/progress.h>
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};
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;};
void BuildGroupOrs(VerIterator const &V);
void UpdateVerState(PkgIterator Pkg);
- bool Init();
+ bool Init(OpProgress *Prog);
protected:
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);
public:
// Policy implementation
- virtual VerIterator GetCandidateVer(PkgIterator Pkg);
+ virtual VerIterator GetCandidateVer(PkgIterator Pkg,bool AllowCurrent = true);
virtual bool IsImportantDep(DepIterator Dep);
// Accessors
// 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();
};