apt @VERSION@
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

pkgDepCache Class Reference

Inheritance diagram for pkgDepCache:
pkgCache::Namespace

List of all members.

Classes

class  ActionGroup
 Represents an active action group. More...
class  DefaultRootSetFunc
 Returns true for packages matching a regular expression in APT::NeverAutoRemove. More...
class  InRootSetFunc
 An arbitrary predicate on packages. More...
class  Policy
struct  StateCache

Public Types

enum  DepFlags {
  DepNow = (1 << 0), DepInstall = (1 << 1), DepCVer = (1 << 2), DepGNow = (1 << 3),
  DepGInstall = (1 << 4), DepGCVer = (1 << 5)
}
enum  DepStateFlags {
  DepNowPolicy = (1 << 0), DepNowMin = (1 << 1), DepInstPolicy = (1 << 2), DepInstMin = (1 << 3),
  DepCandPolicy = (1 << 4), DepCandMin = (1 << 5)
}
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 }

Public Member Functions

void BuildGroupOrs (VerIterator const &V)
void UpdateVerState (PkgIterator Pkg)
 operator pkgCache & ()
HeaderHead ()
GrpIterator GrpBegin ()
PkgIterator PkgBegin ()
GrpIterator FindGrp (string const &Name)
PkgIterator FindPkg (string const &Name)
PkgIterator FindPkg (string const &Name, string const &Arch)
pkgCacheGetCache ()
pkgVersioningSystemVS ()
VerIterator GetCandidateVer (PkgIterator const &Pkg)
bool IsImportantDep (DepIterator Dep)
PolicyGetPolicy ()
StateCacheoperator[] (PkgIterator const &I)
unsigned char & operator[] (DepIterator const &I)
virtual InRootSetFuncGetRootSetFunc ()
virtual bool MarkFollowsRecommends ()
virtual bool MarkFollowsSuggests ()
bool MarkAndSweep (InRootSetFunc &rootFunc)
 Update the Marked and Garbage fields of all packages.
bool MarkAndSweep ()
virtual bool IsInstallOk (const PkgIterator &Pkg, bool AutoInst=true, unsigned long Depth=0, bool FromUser=true)
virtual bool IsDeleteOk (const PkgIterator &Pkg, bool Purge=false, unsigned long Depth=0, bool FromUser=true)
bool readStateFile (OpProgress *prog)
bool writeStateFile (OpProgress *prog, bool InstalledOnly=true)
signed long long UsrSize ()
unsigned long long DebSize ()
unsigned long DelCount ()
unsigned long KeepCount ()
unsigned long InstCount ()
unsigned long BrokenCount ()
unsigned long PolicyBrokenCount ()
unsigned long BadCount ()
bool Init (OpProgress *Prog)
void Update (OpProgress *Prog=0)
 pkgDepCache (pkgCache *Cache, Policy *Plcy=0)
State Manipulators
void MarkKeep (PkgIterator const &Pkg, bool Soft=false, bool FromUser=true, unsigned long Depth=0)
void MarkDelete (PkgIterator const &Pkg, bool Purge=false, unsigned long Depth=0, bool FromUser=true)
void MarkInstall (PkgIterator const &Pkg, bool AutoInst=true, unsigned long Depth=0, bool FromUser=true, bool ForceImportantDeps=false)
void MarkProtected (PkgIterator const &Pkg)
void SetReInstall (PkgIterator const &Pkg, bool To)
void SetCandidateVersion (VerIterator TargetVer, bool const &Pseudo=true)
bool SetCandidateRelease (pkgCache::VerIterator TargetVer, std::string const &TargetRel)
bool SetCandidateRelease (pkgCache::VerIterator TargetVer, std::string const &TargetRel, std::list< std::pair< pkgCache::VerIterator, pkgCache::VerIterator > > &Changed)
void MarkAuto (const PkgIterator &Pkg, bool Auto)

Protected Member Functions

bool CheckDep (DepIterator Dep, int Type, PkgIterator &Res)
bool CheckDep (DepIterator Dep, int Type)
unsigned char DependencyState (DepIterator &D)
unsigned char VersionState (DepIterator D, unsigned char Check, unsigned char SetMin, unsigned char SetPolicy)
void Update (DepIterator Dep)
void Update (PkgIterator const &P)
void AddSizes (const PkgIterator &Pkg, bool const &Invert=false)
void RemoveSizes (const PkgIterator &Pkg)
void AddSizes (const PkgIterator &Pkg, signed long Mult) __deprecated
void AddStates (const PkgIterator &Pkg, int Add=1)
void RemoveStates (const PkgIterator &Pkg)

Protected Attributes

pkgCacheCache
StateCachePkgState
unsigned char * DepState
signed long long iUsrSize
unsigned long long iDownloadSize
unsigned long iInstCount
unsigned long iDelCount
unsigned long iKeepCount
unsigned long iBrokenCount
unsigned long iPolicyBrokenCount
unsigned long iBadCount
bool DebugMarker
bool DebugAutoInstall
PolicydelLocalPolicy
PolicyLocalPolicy

Friends

class ActionGroup

Member Function Documentation

pkgDepCache::InRootSetFunc * GetRootSetFunc ( ) [virtual]
Returns:
A function identifying packages in the root set other than manually installed packages and essential packages, or NULL if an error occurs.
Todo:
Is this the best place for this function? Perhaps the settings for mark-and-sweep should be stored in a single external class?

References Configuration::MatchAgainstConfig::wasConstructedSuccessfully().

bool IsDeleteOk ( const PkgIterator Pkg,
bool  Purge = false,
unsigned long  Depth = 0,
bool  FromUser = true 
) [virtual]
Returns:
true if it's OK for MarkDelete to remove the given package.

See the default implementation for a simple example how this method can be used. Overriding implementations should use the hold-state-flag to cache results from previous checks of this package - also it should be used if the default resolver implementation is also used to ensure that these packages are handled like "normal" dpkg holds.

The parameters are the same as in the calling MarkDelete:

Parameters:
Pkgthe package that MarkDelete wants to remove.
Purgeshould we purge instead of "only" remove?
Depthrecursive deep of this Marker call
FromUserwas the remove requested by the user?
bool IsInstallOk ( const PkgIterator Pkg,
bool  AutoInst = true,
unsigned long  Depth = 0,
bool  FromUser = true 
) [virtual]
Returns:
true if it's OK for MarkInstall to install the given package.

See the default implementation for a simple example how this method can be used. Overriding implementations should use the hold-state-flag to cache results from previous checks of this package - also it should be used if the default resolver implementation is also used to ensure that these packages are handled like "normal" dpkg holds.

The parameters are the same as in the calling MarkInstall:

Parameters:
Pkgthe package that MarkInstall wants to install.
AutoInstneeds a previous MarkInstall this package?
Depthrecursive deep of this Marker call
FromUserwas the install requested by the user?
bool MarkAndSweep ( InRootSetFunc rootFunc) [inline]

Update the Marked and Garbage fields of all packages.

This routine is implicitly invoked after all state manipulators and when an ActionGroup is destroyed. It invokes #MarkRequired and #Sweep to do its dirty work.

Parameters:
rootFuncA predicate that returns true for packages that should be added to the root set.

References MarkAndSweep().

Referenced by MarkAndSweep().

void MarkAuto ( const PkgIterator Pkg,
bool  Auto 
)

Set the "is automatically installed" flag of Pkg.

bool MarkFollowsRecommends ( ) [virtual]
Returns:
true if the garbage collector should follow recommendations.
bool MarkFollowsSuggests ( ) [virtual]
Returns:
true if the garbage collector should follow suggestions.
bool SetCandidateRelease ( pkgCache::VerIterator  TargetVer,
std::string const &  TargetRel,
std::list< std::pair< pkgCache::VerIterator, pkgCache::VerIterator > > &  Changed 
)

Set the candidate version for dependencies too if needed.

Sets not only the candidate version as SetCandidateVersion does, but walks also down the dependency tree and checks if it is required to set the candidate of the dependency to a version from the given release, too.

Parameters:
TargetVernew candidate version of the package
TargetReltry to switch to this release if needed
[out]Changeda list of pairs consisting of the old version of the changed package and the version which required the switch of this dependency
Returns:
true if the switch was successful, false otherwise

Member Data Documentation

unsigned long long iDownloadSize [protected]

Stores how much we need to download to get the packages

signed long long iUsrSize [protected]

Stores the space changes after installation


The documentation for this class was generated from the following files: