summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-06-29 06:11:36 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-06-29 06:11:36 +0000
commit0a57c0f0e4d0bc3474ce4d2101f36a997891d30d (patch)
treedc4aadd2882cbb27291e16af181cc562257d2b78 /apt-pkg/depcache.h
parent254ce4b0cc0336de5a9b46c693673ef68d5628b6 (diff)
* use mark-and-sweep from aptitude now as GC algorithm
Diffstat (limited to 'apt-pkg/depcache.h')
-rw-r--r--apt-pkg/depcache.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index e02ed72f0..c91e09ab3 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -63,6 +63,10 @@ class pkgDepCache : protected pkgCache::Namespace
enum VersionTypes {NowVersion, InstallVersion, CandidateVersion};
enum ModeList {ModeDelete = 0, ModeKeep = 1, ModeInstall = 2};
+
+ // Flags for the GC
+ enum ChangedReason {Manual, UserAuto, Libapt, FromResolver, PkgIsUnused};
+
struct StateCache
{
// Epoch stripped text versions of the two version fields
@@ -79,9 +83,13 @@ class pkgDepCache : protected pkgCache::Namespace
unsigned short Flags;
unsigned short iFlags; // Internal flags
- // Traversal status and state for automatic removal
- unsigned char DirtyState;
- unsigned char AutomaticRemove;
+ // mark and sweep flags
+ ChangedReason InstallReason;
+#if 0
+ ChangedReason RemoveReason;
+#endif
+ bool Marked;
+ bool Garbage;
// Various tree indicators
signed char Status; // -1,0,1,2
@@ -103,7 +111,6 @@ class pkgDepCache : protected pkgCache::Namespace
inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;};
inline bool InstBroken() const {return (DepState & DepInstMin) != DepInstMin;};
inline bool Install() const {return Mode == ModeInstall;};
- inline unsigned char Dirty() const {return DirtyState;};
inline VerIterator InstVerIter(pkgCache &Cache)
{return VerIterator(Cache,InstallVer);};
inline VerIterator CandidateVerIter(pkgCache &Cache)
@@ -194,7 +201,6 @@ class pkgDepCache : protected pkgCache::Namespace
unsigned long Depth = 0);
void SetReInstall(PkgIterator const &Pkg,bool To);
void SetCandidateVersion(VerIterator TargetVer);
- void SetDirty(PkgIterator const &Pkg, pkgCache::State::PkgRemoveState To);
// This is for debuging
void Update(OpProgress *Prog = 0);