ALPM::DB - Database base class, inherited by local and sync databases.
use ALPM::Conf qw(/etc/pacman.conf); my $db = $alpm->localdb; printf "Playing with %s database\n", $db->name; my $perl = $db->find('perl') or die 'where is perl'; $db = $alpm->register('community') or die; $db->add_mirror('ftp://ftp.archlinux.org/community/os/i686') or die; for my $pkg ($db->search('perl')){ printf "%s\t%s\n", $pkg->name, $pkg->version; } for my $pkg ($db->find_group('xfce4')){ printf "xfce4:\t%s\t%s\n", $pkg->name, $pkg->version; } my %grps = $db->groups; while(my($g, $pkgs) = each %grps){ printf "%s\t%s\n", $g, $_->name for(@$pkgs); }
$NAME = $DB->name()
$NAME
The previously assigned name of the database or 'local' for the local database.
@PKGS = $DB->pkgs()
@PKGS
A list of packages in the package cache for this database.
$PKGS | undef = $DB->find($NAME)
The exact name of a package to look for.
$PKGS
On success, an ALPM::Package object of the package found.
undef
On failure, returned when a matching package is not found.
@PKGS = $DB->search($MATCH)
$MATCH
A substring to search for within the names of packages.
A list of found packages, in the form of ALPM::Package objects. This may be empty.
%GROUPS = $DB->groups()
%GROUPS
A hash (name/value pairs) of groups contained within the database. Each group name is followed by an arrayref of ALPM::Package objects. This may be empty.
@PKGS = $DB->find_group($NAME)
The exact name of a group to search for.
A list of packages which belong to the given group name. If no group was found then this is empty.
ALPM::DB::Local, ALPM::DB::Sync, ALPM::Package, ALPM
Justin Davis, <juster at cpan dot org>
<juster at cpan dot org>
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.
To install ALPM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ALPM
CPAN shell
perl -MCPAN -e shell install ALPM
For more information on module installation, please visit the detailed CPAN module installation guide.