Name
Cache::Apt::Package - Package handler for apt-cross and related tools
Description
Turns the awkward libapt-pkg-perl API into an Object-oriented set of
structs that can be passed around between scripts. Uses an extensively
modified portion of NorthernCross to provide the data contained in the
structs. Together with Cache and Config, Package will form a new Debian
package: libcache-apt-perl
The structures are designed to be discrete and do not contain self-
referencing variables as are found in apt-pkg-perl. All instances can
be safely used with Data::Dumper to inspect the contents - most
functions support a $verbose setting that can dump the contents of the
current package to the console using Data::Dumper.
Copyright and Licence
Copyright (C) 2007 Neil Williams <codehelp@debian.org>
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Bugs
Please report bugs via the Debian Bug Tracking System.
Support
All enquiries to the "<debian-embedded@lists.debian.org"> mailing list.
AptCrossPackage
The struct that is used to describe a package.
Note that Depends is an array - it needs to be an array of
AptCrossDependency structs.
struct (AptCrossPackage => {
"Package" => '$',
"Version" => '$',
"Source" => '$',
"Distribution" => '$',
"Architecture" => '$',
"Maintainer" => '$',
"Size" => '$',
"Installed" => '$',
"Section" => '$',
"Priority" => '$',
"Build_Depends" => '$',
"Build_Depends_Indep" => '$',
"Depends" => '@',
"Description" => '$',
"Summary" => '$',
"Recommends" => '$',
"Suggests" => '$',
"Filename" => '$',
"Provides" => '$',
"FileMD5Hash" => '$',
});
AptCrossDependency
AptCrossPackage->Depends is an array of AptCrossDependency instances
describing the dependency.
VersionLimit is the version indicator for this dependency and the
version string itself - but not the parentheses. (Undefined in the case
of OR dependencies.)
e.g.
>= 1.2.3-1
<< 0.56-2
>> 1.3~r345-1
struct (AptCrossDependency => {
"Package" => '$',
"VersionLimit" => '$',
"Installed" => '$',
"Type" => '$',
"Operator" => '$',
"List" => '$',
});
AptCrossDependency::List contains the OR’d list of packages if
AptCrossDependency::Operator eq "|" and is undefined otherwise.
’debconf’ is special-cased because the ’|’ operator does not appear in
the apt-cache data. Incidences of this hack will show up in STDERR if
$verbose >= 3 but are otherwise silent. The hack converts ’debconf’
into ’debconf (>= 0.5) | debconf-2.0’ in AptCrossDependency::List and
sets AptCrossDependency::Operator to ’|’ but includes support for
specific version limits if those are specified, e.g. ’debconf (>=
1.2.0) | debconf-2.0’. If there are other packages where the OR’d list
is incorrect, please check the output from using &output_pkg with
$verbose >= 3 and include the output in a bug report against libcache-
apt-perl.
lookup_pkg
Populate an AptCrossPackage with data from the cache.
Use this function to remove some of the pain of working directly with
the apt-pkg-perl constructs or even AptCross::Cache functions.
Note that this lookup operates on the binary package name.
output_pkg
Creates output on STDOUT to imitate dpkg-query -s or apt-cache show
Certain values are not available via the current perl bindings.