
Parse::Debian::PackageDesc - Parses Debian changes and source package files

use Parse::Debian::PackageDesc;
my $changes = Parse::Debian::PackageDesc->new('/path/foo.changes');
my $source = Parse::Debian::PackageDesc->new('/path/foo.dsc');
my $pkg = Parse::Debian::PackageDesc->new($changes_or_dsc,
gpg_homedir => '/dir/gnupg');
print $pkg->name, "\n";
print $pkg->version, "\n";
print $pkg->debian_revision, "\n";
print $pkg->distribution, "\n";
print join(", ", $pkg->binary_packages), "\n";
print $pkg->changes, "\n";

Parse::Debian::PackageDesc parses a Debian .changes file (or a .dsc file) and allows you to retrieve its information easily. It can even check for GPG signatures, assuming you have GNUPG installed and an appropriate configuration.

new($path)
new($path, %user_opts)Creates a new object representing the .changes or .dsc file in $path. The only valid option for %user_opts is gpg_homedir, which points to the GNUPG home directory with the appropriate options and keyrings for GPG signature validation.
pathReturns the changes/dsc file path (the one given in the constructor).
dateReturns the latest package revision date.
name
sourceReturns the name of the source package.
versionReturns the full package version.
upstream_versionReturns the upstream version of the package. For native packages, the full version is returned.
debian_revisionReturns just the Debian revision of the package. So, if the full version is 3.15-5, it returns just 5. For native packages, "" is returned.
distributionReturns the distribution the package is for.
urgencyReturns the urgency for the package.
maintainerReturns the package maintainer.
changed_byReturns who made the upload.
binary_packagesReturns a list of binary package names in the changes/dsc file.
changesReturns the latest package revision changelog entry.
filesReturns the list of files referenced by the changes/dsc file.
binary_package_filesReturns the list of binary package files referenced by the changes/dsc file.
signature_idReturns the key id for the signature of the changes/dsc file, or undef if there was no signature or there was some error with gpg.
correct_signatureReturns whether the the changes/dsc file has a correct signature.

This module requires no configuration file or environment variables. However, you may want to setup a special GNUPG directory with a defined keyring to validate the GNUPG signatures.

Esteban Manchado Velázquez <estebanm@opera.com>.

This code is offered under the Open Source BSD license.
Copyright (c) 2009, Opera Software. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.