.\" 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::Source 3pm" .TH AptPkg::Source 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::Source \- APT source package interface .SH "SYNOPSIS" .IX Header "SYNOPSIS" use AptPkg::Source; .SH "DESCRIPTION" .IX Header "DESCRIPTION" The AptPkg::Source module provides an interface to \fB\s-1APT\s0\fR's source package lists. .SS "AptPkg::Source" .IX Subsection "AptPkg::Source" The AptPkg::Source package implements the \fB\s-1APT\s0\fR pkgSrcRecords class as a hash reference (inherits from AptPkg::hash). The hash is keyed on source or binary package name and the value is an array reference of the details of matching source packages. .PP Note that there is no iterator class, so it is not possible to get a list of all keys (with keys or each). .PP \fIConstructor\fR .IX Subsection "Constructor" .IP "new([\fI\s-1SOURCELIST\s0\fR])" 4 .IX Item "new([SOURCELIST])" Instantiation of the object uses configuration from the \&\f(CW$AptPkg::Config::_config\fR object (automatically initialised if not done explicitly). .Sp If no \fI\s-1SOURCELIST\s0\fR is specified, then the value of Dir::Etc::sourcelist from the configuration object is used (generally /etc/apt/sources.list). .PP \fIMethods\fR .IX Subsection "Methods" .IP "find(\fI\s-1PACK\s0\fR, [\fI\s-1SRCONLY\s0\fR])" 4 .IX Item "find(PACK, [SRCONLY])" In a list context, return a list of source package details for the given \fI\s-1PACK\s0\fR, which may either be a source package name, or the name of one of the binaries provided (unless \fI\s-1SRCONLY\s0\fR is provided and true). .Sp In a scalar context, the source package name of the first entry is returned. .IP "get, exists" 4 .IX Item "get, exists" These methods are used to implement the hashref abstraction: \&\f(CW$obj\fR\->get($pack) and \f(CW$obj\fR\->{$pack} are equivalent. .Sp The get method has the same semantics as find, but returns an array reference in a scalar context. .PP The list returned by the find (and get) methods consists of hashes which describe each available source package (in order of discovery from the deb-src files described in sources.list). .PP Each hash contains the following entries: .IP "Package" 4 .IX Item "Package" .PD 0 .IP "Version" 4 .IX Item "Version" .IP "Maintainer" 4 .IX Item "Maintainer" .IP "Section" 4 .IX Item "Section" .PD Strings giving the source package name, version, maintainer and section. .IP "AsStr" 4 .IX Item "AsStr" The full source record as a string in Debian control file syntax , which is an RFC822\-like set of key-value pairs with the values potentially wrapped. It is relatively trivial to parse: .Sp .Vb 1 \& my %fields = map { split /:\es+/ } split /\en(?! )/, $as_str; .Ve .IP "Binaries" 4 .IX Item "Binaries" A list of binary package names from the package. .IP "BuildDepends" 4 .IX Item "BuildDepends" A hash describing the build dependencies of the package. Possible keys are: .RS 4 .Sp .RS 4 \&\f(CW\*(C`Build\-Depends\*(C'\fR, \f(CW\*(C`Build\-Depends\-Indep\*(C'\fR, \f(CW\*(C`Build\-Conflicts\*(C'\fR, \&\f(CW\*(C`Build\-Conflicts\-Indep\*(C'\fR. .RE .RE .RS 4 .Sp The values are a list of dependencies/conflicts with each item being a list containing the package name followed optionally by an operator and version number. .Sp Operator values evaluate to a comparison string* (>, >=, etc) or one of the AptPkg::Dep:: constants in a numeric context (see \&\*(L"pkgCache::Dep::DepCompareOp\*(R" in \fBAptPkg\fR\|(3pm)). .Sp *Note that this is a normalised, rather than Debian-style (>> vs >) string. .RE .IP "Files" 4 .IX Item "Files" A list of files making up the source package, each described by a hash containing the keys: .RS 4 .Sp .RS 4 \&\f(CW\*(C`Checksum\-FileSize\*(C'\fR, \f(CW\*(C`MD5Hash\*(C'\fR, \f(CW\*(C`SHA256\*(C'\fR, \f(CW\*(C`Size\*(C'\fR, \f(CW\*(C`ArchiveURI\*(C'\fR, \&\f(CW\*(C`Type\*(C'\fR. .RE .RE .RS 4 .RE .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBAptPkg::Config\fR\|(3pm), \fBAptPkg::Cache\fR\|(3pm), \fBAptPkg\fR\|(3pm), \fBAptPkg::hash\fR\|(3pm). .SH "AUTHOR" .IX Header "AUTHOR" Brendan O'Dea