DPKG::Log::Analyse::Package(3pm)

DPKG::Log::Analyse::Package3pm

Describe a package as analysed from a dpkg.log

Usage

use DPKG::Log;

my $package = DPKG::Log::Analyse::Package->new('package' => 'foobar');

Version

version 1.20

Overview

This module is used to analyse a dpkg log.

Methods

$package = DPKG::Log::Analyse::Package->new('package' => 'foobar')

Returns a new DPKG::Log::Analyse::Package object.

$package_name = $package->name;

Returns the name of this package.

$package->version

Return or set the version of this package.

$package->previous_version

Return or set the previous version of this package.

$package->status

Return or set the status of this package.

equals($package1, $package2);
print "equal" if $package1 eq $package2

Compares two packages in their string representation.

compare($package1, $package2)
print "greater" if $package1 > $package2

Compare two packages. See OVERLOADING for details on how the comparison works.

$package_str = $package->as_string
printf("Package name: %s", $package);

Return this package as a string. This will return the package name and the version (if set) in the form package_name/version. If version is not set, it will return the package name only.

Overloading

This module explicitly overloads some operators. Each operand is expected to be a DPKG::Log::Analyse::Package object.

The string comparison operators, "eq" or "ne" will use the string value for the comparison.

The numerical operators will use the package name and package version for comparison. That means a package1 == package2 if package1->name equals package2->name AND package1->version == package2->version.

The module stores versions as Dpkg::Version objects, therefore sorting different versions of the same package will work.

This module also overloads stringification returning either the package name if no version is set or "package_name/version" if a version is set.

Releases

Unchanged in 3 releases since Debian 7 (Wheezy).

  1. 7–9

Author

Patrick Schoenfeld <[email protected]>.

From libdpkg-log-perl 1.20-2 in Debian 9 (Stretch). Parsed by carta from the page's man source.