apt  0.9.11.2
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
pkgDepCache Class Reference
Inheritance diagram for pkgDepCache:
pkgCache::Namespace

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 (std::string const &Name)
 
PkgIterator FindPkg (std::string const &Name)
 
PkgIterator FindPkg (std::string const &Name, std::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. More...
 
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 MarkPurge=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
bool MarkKeep (PkgIterator const &Pkg, bool Soft=false, bool FromUser=true, unsigned long Depth=0)
 
bool MarkDelete (PkgIterator const &Pkg, bool MarkPurge=false, unsigned long Depth=0, bool FromUser=true)
 
bool 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 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 AddStates (const PkgIterator &Pkg, bool const Invert=false)
 
void RemoveStates (const PkgIterator &Pkg)
 
bool IsInstallOkMultiArchSameVersionSynced (PkgIterator const &Pkg, bool const AutoInst, unsigned long const Depth, bool const FromUser)
 
bool IsDeleteOkProtectInstallRequests (PkgIterator const &Pkg, bool const rPurge, unsigned long const Depth, bool const FromUser)
 

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
 

Additional Inherited Members

- Protected Types inherited from pkgCache::Namespace
typedef pkgCache::GrpIterator GrpIterator
 
typedef pkgCache::PkgIterator PkgIterator
 
typedef pkgCache::VerIterator VerIterator
 
typedef pkgCache::DescIterator DescIterator
 
typedef pkgCache::DepIterator DepIterator
 
typedef pkgCache::PrvIterator PrvIterator
 
typedef pkgCache::PkgFileIterator PkgFileIterator
 
typedef pkgCache::VerFileIterator VerFileIterator
 
typedef pkgCache::Version Version
 
typedef pkgCache::Description Description
 
typedef pkgCache::Package Package
 
typedef pkgCache::Header Header
 
typedef pkgCache::Dep Dep
 
typedef pkgCache::Flag Flag
 

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  MarkPurge = false,
unsigned long  Depth = 0,
bool  FromUser = true 
)
virtual
Returns
true if it's OK for MarkDelete to remove the given package.

The default implementation simply calls all IsDeleteOk* method mentioned below, see also IsInstallOk.

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.

The default implementation simply calls all IsInstallOk* method mentioned below.

Overriding implementations should use the hold-state-flag to cache results from previous checks of this package - if possible.

The parameters are the same as in the calling MarkInstall:

Parameters
Pkgthe package that MarkInstall wants to install.
AutoInstinstall this and all its dependencies
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.
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: