.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AptPkg::Cache 3pm" .TH AptPkg::Cache 3pm "2021-02-15" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" AptPkg::Cache \- APT package cache interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" use AptPkg::Cache; .SH "DESCRIPTION" .IX Header "DESCRIPTION" The AptPkg::Cache module provides an interface to \fB\s-1APT\s0\fR's package cache. .SS "AptPkg::Cache" .IX Subsection "AptPkg::Cache" The AptPkg::Cache package implements the \fB\s-1APT\s0\fR 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). .PP \fIConstructor\fR .IX Subsection "Constructor" .IP "new([\fI\s-1LOCK\s0\fR])" 4 .IX Item "new([LOCK])" Instantiation of the object uses configuration from the \&\f(CW$AptPkg::Config::_config\fR and \f(CW$AptPkg::System::_system\fR objects (automatically initialised if not done explicitly). .Sp The cache initialisation can be quite verbose\*(--controlled by the value of \f(CW$_config\fR\->{quiet}, which is set to \*(L"2\*(R" (quiet) if the \f(CW$_config\fR object is auto-initialised. .Sp The cache directory is locked if \s-1LOCK\s0 is true. .Sp 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. .PP \fIMethods\fR .IX Subsection "Methods" .IP "files" 4 .IX Item "files" Return a list of AptPkg::Cache::PkgFile objects describing the package files. .IP "packages" 4 .IX Item "packages" Return an AptPkg::PkgRecords object which may be used to retrieve additional information about packages. .IP "get, exists, keys" 4 .IX Item "get, exists, keys" These methods are used to implement the hashref abstraction: \&\f(CW$obj\fR\->get($pack) and \f(CW$obj\fR\->{$pack} are equivalent. .IP "is_multi_arch" 4 .IX Item "is_multi_arch" Cache is multi-arch enabled. .IP "native_arch" 4 .IX Item "native_arch" Native architecture. .SS "AptPkg::Cache::Package" .IX Subsection "AptPkg::Cache::Package" Implements the \fB\s-1APT\s0\fR pkgCache::PkgIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "Name" 4 .IX Item "Name" .PD 0 .IP "Section" 4 .IX Item "Section" .IP "Arch" 4 .IX Item "Arch" .PD Package name, section and architecture. .IP "FullName" 4 .IX Item "FullName" Fully qualified name, including architecture. .IP "ShortName" 4 .IX Item "ShortName" The shortest unambiguous package name: the same as \f(CW\*(C`Name\*(C'\fR for native packages, and \f(CW\*(C`FullName\*(C'\fR for non-native. .IP "SelectedState" 4 .IX Item "SelectedState" .PD 0 .IP "InstState" 4 .IX Item "InstState" .IP "CurrentState" 4 .IX Item "CurrentState" .PD Package state from the status file. .Sp SelectedState may be \f(CW\*(C`Unknown\*(C'\fR, \f(CW\*(C`Install\*(C'\fR, \f(CW\*(C`Hold\*(C'\fR, \f(CW\*(C`DeInstall\*(C'\fR or \&\f(CW\*(C`Purge\*(C'\fR. .Sp InstState may be \f(CW\*(C`Ok\*(C'\fR, \f(CW\*(C`ReInstReq\*(C'\fR, \f(CW\*(C`HoldInst\*(C'\fR or \f(CW\*(C`HoldReInstReq\*(C'\fR. .Sp CurrentState may be \f(CW\*(C`NotInstalled\*(C'\fR, \f(CW\*(C`UnPacked\*(C'\fR, \f(CW\*(C`HalfConfigured\*(C'\fR, \&\f(CW\*(C`HalfInstalled\*(C'\fR, \f(CW\*(C`ConfigFiles\*(C'\fR or \f(CW\*(C`Installed\*(C'\fR. .Sp In a numeric context, SelectedState, InstState and CurrentState evaluate to an AptPkg::State:: constant. .IP "VersionList" 4 .IX Item "VersionList" A reference to an array of AptPkg::Cache::Version objects describing available versions of the package. .IP "CurrentVer" 4 .IX Item "CurrentVer" An AptPkg::Cache::Version object describing the currently installed version (if any) of the package. .IP "RevDependsList" 4 .IX Item "RevDependsList" A reference to an array of AptPkg::Cache::Depends objects describing packages which depend upon the current package. .IP "ProvidesList" 4 .IX Item "ProvidesList" For virtual packages, this is a reference to an array of AptPkg::Cache::Provides objects describing packages which provide the current package. .IP "Flags" 4 .IX Item "Flags" A comma separated list if flags: \f(CW\*(C`Auto\*(C'\fR, \f(CW\*(C`Essential\*(C'\fR or \&\f(CW\*(C`Important\*(C'\fR. .Sp In a numeric context, evaluates to a combination of AptPkg::Flag:: constants. .Sp [Note: the only one of these you need worry about is \f(CW\*(C`Essential\*(C'\fR, which is set based on the package's header of the same name. \f(CW\*(C`Auto\*(C'\fR seems to be used internally by \fB\s-1APT\s0\fR, and \f(CW\*(C`Important\*(C'\fR seems to only be set on the apt package.] .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the package record. .SS "AptPkg::Cache::Version" .IX Subsection "AptPkg::Cache::Version" Implements the \fB\s-1APT\s0\fR pkgCache::VerIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "VerStr" 4 .IX Item "VerStr" .PD 0 .IP "Section" 4 .IX Item "Section" .IP "Arch" 4 .IX Item "Arch" .PD The package version, section and architecture. .IP "MultiArch" 4 .IX Item "MultiArch" Multi-arch state: \f(CW\*(C`No\*(C'\fR, \f(CW\*(C`All\*(C'\fR, \f(CW\*(C`Foreign\*(C'\fR, \f(CW\*(C`Same\*(C'\fR, \f(CW\*(C`Allowed\*(C'\fR, \&\f(CW\*(C`AllForeign\*(C'\fR or \f(CW\*(C`AllAllowed\*(C'\fR. .Sp In a numeric context, evaluates to an AptPkg::Version:: constant. .IP "ParentPkg" 4 .IX Item "ParentPkg" An AptPkg::Cache::Package objct describing the package providing this version. .IP "DescriptionList" 4 .IX Item "DescriptionList" A list of AptCache::Cache::Description objects describing the files which describe a package version. The list includes both Package files and Translation files, which contain translated Description fields. .IP "TranslatedDescription" 4 .IX Item "TranslatedDescription" An AptCache::Cache::Description object for the current locale, which will generally be a Translation file. .IP "DependsList" 4 .IX Item "DependsList" A reference to an array of AptPkg::Cache::Depends objects describing packages which the current package depends upon. .IP "ProvidesList" 4 .IX Item "ProvidesList" A reference to an array of AptPkg::Cache::Provides objects describing virtual packages provided by this version. .IP "FileList" 4 .IX Item "FileList" A reference to an array of AptPkg::Cache::VerFile objects describing the packages files which include the current version. .IP "Size" 4 .IX Item "Size" The \fI.deb\fR file size, in bytes. .IP "InstalledSize" 4 .IX Item "InstalledSize" The disk space used when installed, in bytes. .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the version record. .IP "Priority" 4 .IX Item "Priority" Package priority: \f(CW\*(C`important\*(C'\fR, \f(CW\*(C`required\*(C'\fR, \f(CW\*(C`standard\*(C'\fR, \f(CW\*(C`optional\*(C'\fR or \f(CW\*(C`extra\*(C'\fR. .Sp In a numeric context, evaluates to an AptPkg::VerPriority:: constant. .SS "AptPkg::Cache::Depends" .IX Subsection "AptPkg::Cache::Depends" Implements the \fB\s-1APT\s0\fR pkgCache::DepIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "DepType" 4 .IX Item "DepType" Type of dependency: \f(CW\*(C`Depends\*(C'\fR, \f(CW\*(C`PreDepends\*(C'\fR, \f(CW\*(C`Suggests\*(C'\fR, \&\f(CW\*(C`Recommends\*(C'\fR, \f(CW\*(C`Conflicts\*(C'\fR, \f(CW\*(C`Replaces\*(C'\fR or \f(CW\*(C`Obsoletes\*(C'\fR. .Sp In a numeric context, evaluates to an AptPkg::Dep:: constant. .IP "ParentPkg" 4 .IX Item "ParentPkg" .PD 0 .IP "ParentVer" 4 .IX Item "ParentVer" .PD AptPkg::Cache::Package and AptPkg::Cache::Version objects describing the package declaring the dependency. .IP "TargetPkg" 4 .IX Item "TargetPkg" AptPkg::Cache::Package object describing the depended package. .IP "TargetVer" 4 .IX Item "TargetVer" For versioned dependencies, TargetVer is a string giving the version of the target package required. .IP "CompType" 4 .IX Item "CompType" .PD 0 .IP "CompTypeDeb" 4 .IX Item "CompTypeDeb" .PD CompType gives a normalised comparison operator (>, >=, etc) describing the relationship to TargetVer ("" if none). .Sp CompTypeDeb returns Debian-style operators (>> rather than >). .Sp In a numeric context, both CompType and CompTypeDeb evaluate to an AptPkg::Dep:: constant. .Sp 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). .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the dependency record. .SS "AptPkg::Cache::Provides" .IX Subsection "AptPkg::Cache::Provides" Implements the \fB\s-1APT\s0\fR pkgCache::PrvIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "Name" 4 .IX Item "Name" Name of virtual package. .IP "OwnerPkg" 4 .IX Item "OwnerPkg" .PD 0 .IP "OwnerVer" 4 .IX Item "OwnerVer" .PD AptPkg::Cache::Package and AptPkg::Cache::Version objects describing the providing package. .IP "ProvideVersion" 4 .IX Item "ProvideVersion" Version of the virtual package. [Not currently supported by dpkg] .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the provides record. .SS "AptPkg::Cache::VerFile" .IX Subsection "AptPkg::Cache::VerFile" Implements the \fB\s-1APT\s0\fR pkgCache::VerFileIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "File" 4 .IX Item "File" An AptPkg::Cache::PkgFile object describing the packages file. .IP "Offset" 4 .IX Item "Offset" .PD 0 .IP "Size" 4 .IX Item "Size" .PD The byte offset and length of the entry in the file. .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the version file record. .SS "AptPkg::Cache::PkgFile" .IX Subsection "AptPkg::Cache::PkgFile" Implements the \fB\s-1APT\s0\fR pkgCache::PkgFileIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "FileName" 4 .IX Item "FileName" Packages file path. .IP "IndexType" 4 .IX Item "IndexType" File type: \f(CW\*(C`Debian Package Index\*(C'\fR, \f(CW\*(C`Debian dpkg status file\*(C'\fR. .IP "Archive" 4 .IX Item "Archive" .PD 0 .IP "Component" 4 .IX Item "Component" .IP "Version" 4 .IX Item "Version" .IP "Origin" 4 .IX Item "Origin" .IP "Label" 4 .IX Item "Label" .IP "Site" 4 .IX Item "Site" .PD Fields from the Release file. .IP "Index" 4 .IX Item "Index" Internal \fB\s-1APT\s0\fR unique reference for the package file record. .SS "AptPkg::Cache::DescFile" .IX Subsection "AptPkg::Cache::DescFile" Implements the \fB\s-1APT\s0\fR pkgCache::DescFileIterator class as a hash reference. .PP \fIKeys\fR .IX Subsection "Keys" .IP "File" 4 .IX Item "File" An AptPkg::Cache::PkgFile object describing the packages file. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBAptPkg::Config\fR\|(3pm), \fBAptPkg::System\fR\|(3pm), \fBAptPkg\fR\|(3pm), \&\fBAptPkg::hash\fR\|(3pm), \fBAptPkg::PkgRecords\fR\|(3pm), \fBAptPkg::Policy\fR\|(3pm). .SH "AUTHOR" .IX Header "AUTHOR" Brendan O'Dea