AptPkg::Cache - APT package cache interface
use AptPkg::Cache;
The AptPkg::Cache module provides an interface to APT's package cache.
The AptPkg::Cache package implements the APT pkgCacheFile class as a hash reference (inherits from AptPkg::hash). The hash keys are the names of packages in the cache, and the values are AptPkg::Cache::Package objects (which in turn appear as hash references, see below).
Instantiation of the object uses configuration from the $AptPkg::Config::_config and $AptPkg::System::_system objects (automatically initialised if not done explicitly).
The cache initialisation can be quite verbose--controlled by the value of $_config->{quiet}, which is set to "2" (quiet) if the $_config object is auto-initialised.
The cache directory is locked if LOCK is true.
It is important to note that the structure of the returned object contains self-referential elements, so some care must be taken if attempting to traverse it recursively.
Implements the APT pkgCache::PkgIterator class as a hash reference.
Package state from the status file.
SelectedState may be Unknown
, Install
, Hold
, DeInstall
or
Purge
.
InstState may be Ok
, ReInstReq
, HoldInst
or HoldReInstReq
.
CurrentState may be NotInstalled
, UnPacked
, HalfConfigured
,
HalfInstalled
, ConfigFiles
or Installed
.
In a numeric context, SelectedState, InstState and CurrentState evaluate to an AptPkg::State:: constant.
A comma seperated list if flags: Auto
, Essential
or
Important
.
In a numeric context, evaluates to a combination of AptPkg::Flag:: constants.
[Note: the only one of these you need worry about is Essential
,
which is set based on the package's header of the same name. Auto
seems to be used internally by APT, and Important
seems to only
be set on the apt package.]
Implements the APT pkgCache::VerIterator class as a hash reference.
Package priority: important
, required
, standard
, optional
or extra
.
In a numeric context, evaluates to an AptPkg::VerPriority:: constant.
Implements the APT pkgCache::DepIterator class as a hash reference.
Type of dependency: Depends
, PreDepends
, Suggests
,
Recommends
, Conflicts
, Replaces
or Obsoletes
.
In a numeric context, evaluates to an AptPkg::Dep:: constant.
CompType gives a normalised comparison operator (>, >=, etc) describing the relationship to TargetVer ("" if none).
CompTypeDeb returns Debian-style operators (>> rather than >).
In a numeric context, both CompType and CompTypeDeb evaluate to an AptPkg::Dep:: constant.
Alternative dependencies (Depends: a | b) are identified by all but the last having the AptPkg::Dep::Or bit set in the numeric representation of CompType (and CompTypeDeb).
Implements the APT pkgCache::PrvIterator class as a hash reference.
Implements the APT pkgCache::VerFileIterator class as a hash reference.
Implements the APT pkgCache::PkgFileIterator class as a hash reference.
Debian Package Index
, Debian dpkg status file
.
AptPkg::Config(3pm), AptPkg::System(3pm), AptPkg(3pm), AptPkg::hash(3pm), AptPkg::PkgRecords(3pm), AptPkg::Policy(3pm).
Brendan O'Dea <bod@debian.org>