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.
Parse::Debian::PackageDesc
.changes
.dsc
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.
$path
%user_opts
gpg_homedir
path
Returns the changes/dsc file path (the one given in the constructor).
date
Returns the latest package revision date.
name
source
Returns the name of the source package.
version
Returns the full package version.
upstream_version
Returns the upstream version of the package. For native packages, the full version is returned.
debian_revision
Returns 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.
3.15-5
5
""
distribution
Returns the distribution the package is for.
urgency
Returns the urgency for the package.
maintainer
Returns the package maintainer.
changed_by
Returns who made the upload.
binary_packages
Returns a list of binary package names in the changes/dsc file.
changes
Returns the latest package revision changelog entry.
files
Returns the list of files referenced by the changes/dsc file.
binary_package_files
Returns the list of binary package files referenced by the changes/dsc file.
signature_id
Returns 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.
undef
gpg
correct_signature
Returns 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:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Opera Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
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.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Velázquez'. Assuming UTF-8
To install Parse::Debian::PackageDesc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::Debian::PackageDesc
CPAN shell
perl -MCPAN -e shell install Parse::Debian::PackageDesc
For more information on module installation, please visit the detailed CPAN module installation guide.