Reference

Cache::Apt::Package(3)

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 (C) 2007  Neil Williams <[email protected]>
 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/>.

Please report bugs via the Debian Bug Tracking System. All enquiries to the "<[email protected]"> mailing list. 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" =>         '$',
 });

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.

 e.g.
 >= 1.2.3-1
 << 0.56-2
 >> 1.3~r345-1
 struct (AptCrossDependency => {
        "Package" => '$',
        "VersionLimit" => '$',
        "Installed" => '$',
        "Type" => '$',
 });

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. Creates output on STDOUT to imitate dpkg-query -s or apt-cache show Certain values are not available via the current perl bindings.