NAME
ALPM::Package - libalpm packages of files, with dependencies, etc.
SYNOPSIS
use ALPM::Conf qw(/etc/pacman.conf);
my $perlpkg = $alpm->localdb->find('perl');
## All package methods are accessors.
my $name = $perlpkg->name();
print "$name rocks!\n";
## Here is an ugly trick. Please forgive me.
print "@{[$perlpkg->name]} rocks!\n";
## Dependencies are arrayrefs of hashrefs (AoH):
print "$name depends on:\n";
for my $deps (@{$perlpkg->depends}){
print "\t@{$dep}{'name', 'mod', 'version'}\n";
}
## File lists are also arrayrefs of hashrefs (AoH):
print "$name owns files:\n";
for my $f (@{$perlpkg->files}){
printf "\t%s %o %d\n", $f->{'name'}, $f->{'mode'}, $f->{'size'};
}
## Others lists are arrayrefs of scalars:
print "$name is licensed under: @{$perlpkg->licenses}";
DESCRIPTION
This class is a wrapper for all of the alpm_pkg_...
C library functions of libalpm. You retrieve the package from the database and you can then access its information.
ACCESSORS
The accessors are named almost exactly the same as the alpm_pkg_get...
functions. I have removed the get_ prefix on the accessors. This is because you can't really set anything so you should know it's a get anyways.
filename
name
version
desc
url
builddate
installdate
packager
arch
size
isize
reason
licenses
groups
depends
optdepends
conflicts
provides
deltas
replaces
files
backup
has_scriptlet
download_size
changelog
requiredby
optionalfor
db
checkmd5sum
origin
validation
signature
Attributes with plural names return an arrayref of strings. depends and files return an arrayref of hashrefs. db returns an ALPM::DB object.
origin
This should be either "file"
, "localdb"
, or <"syncdb">. If this returns "unknown"
something went wrong.
validation
This returns a string which can either be "unknown"
, "none"
or one or more of the following seperated by spaces: "MD5"
, "SHA"
, or "PGP"
.
signature
Returns the package signature as a string encoded in Base64.
SEE ALSO
AUTHOR
Justin Davis, <juster at cpan dot org>
COPYRIGHT AND LICENSE
Copyright (C) 2015 by Justin Davis
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.