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 "  @{$dep}{'name', 'mod', 'version'}\n";
}

## File lists are also arrayrefs of hashrefs (AoH):
print "$name owns files:\n";
for my $f (@{$perlpkg->files}){
    print "\t%s %o %d", $f->{'name'}, $f->{'mode'}, $f->{'size'};
}

## Others lists are arrayrefs of scalars:
print "$name owns files:\n";
print "  $_\n" foreach (@{$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. They are easy to use if you only want a few attributes.

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

  • db

  • checkmd5sum

Attributes with plural names return an arrayref of strings. depends and files return an arrayref of hashrefs. db returns an ALPM::DB object.

SEE ALSO

ALPM, ALPM::DB

AUTHOR

Justin Davis, <juster at cpan dot org>

COPYRIGHT AND LICENSE

Copyright (C) 2013 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.