ALPM
view release on metacpan or search on metacpan
** ALPM::Group is no longer a class.
Packages groups are now simply lists of packages. When you lookup one
specific group then a list is returned. When querying every single
group (i.e. with ALPM::DB's groups method) a list of name/value pairs
is returned to store it into a hash.
* Release 2.01
** Fix tests to work with custom PKGEXT :BUGFIX:
Tests were failing to work when using a different PKGEXT.
** load_pkgfile error changes to croak instead of die :BUGFIX:
A minor problem I found.
* Release 2.00
** Upgrade for Pacman 3.5
** New Changelog Format
Ditched the old GNU-style ChangeLog format for an org-mode file. Old
ChangeLog entries are at the end of the file...
* Previous Releases
2011-03-05 Justin Davis <juster@cpan.org>
* RELEASE (1.03)
* t: Fix many tests that rely on English language error messages.
* lib/ALPM/LoadConfig.pm (_make_parser): Change the pacman.conf
parser to properly recognize fields which are only field names.
"= <value>" does not necessary follow them.
2011-03-04 Justin Davis <juster@cpan.org>
* RELEASE (1.02)
* lib/ALPM/LoadConfig.pm: Fix bug where config file repos could
2010-05-02 Justin Davis <juster@cpan.org>
* t/04-FakeRepos.t: Add support for .pkg.tar.xz package files.
* lib/ALPM/LoadConfig.pm: Add support for UseDelta setting in
pacman.conf.
2010-01-25 Justin Davis <jrcd83@gmail.com>
* t/04-FakeRepos.t (create_repos): Fixed problems with test
04-FakeRepos where packages would fail to build. Changed
generated test packages to arch "any" so we don't have to check
our arch.
* Makefile.PL: "make clean" will now delete the test repository
share directories (t/repos/share) and the test root
directory (t/root) automatically.
2010-01-04 Justin Davis <jrcd83@gmail.com>
* 0.5 (RELEASE)
* lib/ALPM/LoadConfig.pm (_make_parser): Tweaked regex to accept empty values.
Removed error when an unknown field name is given.
* lib/ALPM.pm: Added ability to set usedelta option, which was missing.
* Makefile.PL: Added repository URL to the META.yml.
* t/07-TiedOptions.t: Hides the warning for the last test using $SIG{__WARN__}.
* t/04-FakeRepos.t (create_repos): Fixed a bug where I must use
the --asroot option when running makepkg inside makepkg, because
of fakeroot.
2009-10-29 Justin Davis <jrcd83@gmail.com>
* 0.4: Released version 0.4
2009-10-08 Justin Davis <jrcd83@gmail.com>
cb.h
typemap
types.c
types.h
t/00-ALPM.t
t/01-Conf.t
t/02-DB.t
t/03-Package.t
t/04-Misc.t
t/05-Callbacks.t
t/repos/build/simpletest/bar/.PKGINFO
t/repos/build/simpletest/bar/usr/foo/bar/bar
t/repos/build/simpletest/foo/.PKGINFO
t/repos/build/simpletest/foo/usr/foo/foo
t/repos/build/upgradetest/foo/.PKGINFO
t/repos/build/upgradetest/foo/usr/foo/foo
t/repos/build/upgradetest/replacebaz/.PKGINFO
t/repos/build/upgradetest/replacebaz/usr/foo/bar/baz
t/repos/repoadd.pl
t/repos/repofin.pl
t/repos/package.pl
t/preptests.pl
lib/ALPM/Conf.pm
lib/ALPM/Conf.pod
lib/ALPM/DB/Local.pod
lib/ALPM/DB/Sync.pod
lib/ALPM/DB.pod
lib/ALPM/Package.pod
lib/ALPM.pm
lib/ALPM.pod
ex/ownzors
ex/dangles
MANIFEST.SKIP view on Meta::CPAN
\.tmp$
\.bak$
\.bs$
\.c$
\.o$
ALPM-.*?\.tar\.gz
Makefile
\.inc$
pm_to_blib
t/repos/share
t/test\.conf
t/root
^\.
PKGBUILD
should instead be possible in the quintessential ugly and succinct perl form.
Small utility scripts, like the examples, can also be quickly drawn up. This
is the new goal of the module.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires the alpm C library that is included with pacman.
libalpm 9.0.0 included with pacman version 4.2.0 was the latest version
used to build and test this module.
DOCUMENTATION
The online documentation is bundled with this module in the form of POD
files under the lib/ directory. To read a document right now you can run
``perldoc lib/ALPM.pod''. These also display formatted in github and are
published on cpan.org or metacpan.org.
COPYRIGHT AND LICENCE
--strip strip all script and doc functionality from
ppport.h
--list-provided list provided API
--list-unsupported list unsupported API
--api-info=name show Perl API portability information
=head1 COMPATIBILITY
This version of F<ppport.h> is designed to support operation with Perl
installations back to 5.003, and has been tested up to 5.10.0.
=head1 OPTIONS
=head2 --help
Display a brief usage summary.
=head2 --version
Display the version of F<ppport.h>.
The result will usually be a list of patches suggesting changes
that should at least be acceptable, if not necessarily the most
efficient solution, or a fix for all possible problems.
If you know that your XS module uses features only available in
newer Perl releases, if you're aware that it uses C++ comments,
and if you want all suggestions as a single patch file, you could
use something like this:
perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
If you only want your code to be scanned without any suggestions
for changes, use:
perl ppport.h --nochanges
You can specify a different C<diff> program or options, using
the C<--diff> option:
perl ppport.h --diff='diff -C 10'
to display information for all known API elements.
=head1 BUGS
If this version of F<ppport.h> is causing failure during
the compilation of this module, please check if newer versions
of either this module or C<Devel::PPPort> are available on CPAN
before sending a bug report.
If F<ppport.h> was generated using the latest version of
C<Devel::PPPort> and is causing failure of this module, please
file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
Please include the following information:
=over 4
=item 1.
The complete output from running "perl -V"
=item 4.
A full log of the build that failed.
=item 5.
Any other information that you think could be relevant.
=back
For the latest version of this code, please get the C<Devel::PPPort>
module from CPAN.
=head1 COPYRIGHT
Version 3.x, Copyright (c) 2004-2009, Marcus Holland-Moritz.
Version 2.x, Copyright (C) 2001, Paul Marquess.
Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
if (s == send)
return 0;
/* next must be digit or the radix separator or beginning of infinity */
if (isDIGIT(*s)) {
/* UVs are at least 32 bits, so the first 9 decimal digits cannot
overflow. */
UV value = *s - '0';
/* This construction seems to be more optimiser friendly.
(without it gcc does the isDIGIT test and the *s - '0' separately)
With it gcc on arm is managing 6 instructions (6 cycles) per digit.
In theory the optimiser could deduce how far to unroll the loop
before checking for overflow. */
if (++s < send) {
int digit = *s - '0';
if (digit >= 0 && digit <= 9) {
value = value * 10 + digit;
if (++s < send) {
digit = *s - '0';
if (digit >= 0 && digit <= 9) {
t/00-ALPM.t view on Meta::CPAN
#!/usr/bin/perl
##
# Initialize ALPM then set and check a few options.
# Checks add/remove on what we can.
# Then create the test repositories.
use Test::More;
BEGIN { use_ok('ALPM') };
## I could not hack this into the Makefile so we initialize
## test repositories here so the modules required are
## only needed when running the tests.
if(system 'perl' => 't/preptests.pl'){
die 'failed to initialize our test root/packages/repos';
}
$ENV{'LANGUAGE'} = 'en_US';
$r = 't/root';
$alpm = ALPM->new($r, "$r/db");
ok $alpm;
ok $alpm->version; # just checks it works
@caps = $alpm->caps;
t/00-ALPM.t view on Meta::CPAN
for $i (0 .. $#v){
is $x[$i], $v[$i], "get_$k has same value as set_$k args";
}
next unless($k =~ s/s$//);
is meth("remove_$k", $v[0]), 1, "remove_$k reported success";
@w = meth("get_${k}s");
ok @w == (@v - 1), "$v[0] removed from ${k}s";
}
# TODO: Test SigLevels more in a later test.
is_deeply $alpm->get_defsiglvl, { 'pkg' => 'never', 'db' => 'never' };
if(grep { /signatures/ } @caps){
$siglvl = { 'pkg' => 'optional', 'db' => 'required' };
ok $alpm->set_defsiglvl($siglvl);
is_deeply $alpm->get_defsiglvl, $siglvl;
$siglvl = { 'pkg' => 'never', 'db' => 'optional trustall' };
ok $alpm->set_defsiglvl($siglvl);
is_deeply $alpm->get_defsiglvl, $siglvl;
t/00-ALPM.t view on Meta::CPAN
eval { $alpm->set_defsiglvl($siglvl); };
if($@ =~ /^ALPM Error: wrong or NULL argument passed/){
pass q{can set siglevel to "never" without GPGME};
}else{
fail 'should not be able to set complicated siglevel without GPGME';
}
}
ok not eval { $alpm->set_defsiglvl('default') };
done_testing;
t/01-Conf.t view on Meta::CPAN
use Test::More;
chomp(my $arch = `uname -m`);
use_ok 'ALPM::Conf';
$conf = ALPM::Conf->new('t/test.conf');
ok $alpm = $conf->parse();
undef $alpm;
ALPM::Conf->import('t/test.conf');
ok $alpm;
is $alpm->get_arch, $arch;
done_testing;
use Test::More;
use ALPM::Conf 't/test.conf';
ok $alpm;
sub checkpkgs
{
my $db = shift;
my $dbname = $db->name;
my %set = map { ($_ => 1) } @_;
for my $p ($db->pkgs){
my $n = $p->name;
unless(exists $set{$n}){
is $db->name, $dbname, 'dbname matches db() arg';
checkpkgs($db, @_);
}
$db = $alpm->localdb;
is $db->name, 'local';
## Make sure DBs are synced.
$_->update or die $alpm->strerror for($alpm->syncdbs);
checkdb('simpletest', qw/foo bar/);
checkdb('upgradetest', qw/foo replacebaz/);
## Check that register siglevel defaults to 'default' when not provided.
$db = $alpm->register('empty') or die 'register failed';
## Due to libalpm trickery, if the db's siglevel is set to default, then the siglevel
## that is retrieved is a copy of the handle's default siglevel.
$siglvl = $alpm->get_defsiglvl;
is_deeply $db->siglvl, $siglvl;
done_testing;
t/03-Package.t view on Meta::CPAN
use Test::More;
use ALPM::Conf 't/test.conf';
sub pkgpath
{
my($dbname, $pkgname) = @_;
$db = $alpm->db($dbname);
$db->update or die $alpm->err;
my($url) = $db->get_servers;
$pkg = $db->find($pkgname) or die "$dbname/$pkgname package is missing";
$url .= q{/} . $pkg->filename;
print "$url\n";
if(($url =~ s{^file://}{}) != 1){
die 'package files are not locally hosted as expected';
}
return $url;
}
$msg = 'load the simpletest/foo package file';
$pkg = $alpm->load_pkgfile(pkgpath('simpletest', 'foo'), 1, 'default');
if($pkg){
pass $msg;
}else{
fail $msg;
die $alpm->strerror;
}
my @methnames = qw{ requiredby name version desc
url builddate installdate packager
arch arch size isize reason
t/03-Package.t view on Meta::CPAN
for my $mname (@methnames) {
my $method_ref = $ALPM::Package::{$mname};
ok $method_ref, "$mname is a package method";
my $result = $method_ref->($pkg);
ok defined $result, "$mname has a defined value";
}
ok defined $pkg->changelog;
done_testing;
t/04-Misc.t view on Meta::CPAN
## Test vercmp.
is(ALPM->vercmp('0.1', '0.2'), -1);
is(ALPM->vercmp('0.10', '0.2'), 1);
is(ALPM->vercmp('0.001', '0.1'), 0); # 0's are skipped
is(ALPM->vercmp('0.100', '0.2'), 1); # 100 > 2
## Test find_dbs_satisfier.
require ALPM::Conf;
ALPM::Conf->import('t/test.conf');
$foo = $alpm->find_dbs_satisfier('foo>1.0', $alpm->syncdbs);
ok $foo;
if($foo){
is $foo->db->name, 'upgradetest';
}
## Test find_satisfier.
$p1 = $alpm->db('simpletest')->find('foo');
$p2 = $alpm->db('upgradetest')->find('foo');
ok $p1 && $p2;
if($p1 && $p2){
$p3 = $alpm->find_satisfier('foo>1.0', $p1, $p2);
is $p3->db->name, 'upgradetest';
}
done_testing;
t/05-Callbacks.t view on Meta::CPAN
use Test::More;
use ALPM::Conf 't/test.conf';
ok !defined $alpm->get_logcb;
$cb = sub { print "LOG: @_" };
die 'internal error' unless(ref($cb) eq 'CODE');
$alpm->set_logcb($cb);
$tmp = $alpm->get_logcb($cb);
is ref($tmp), 'CODE';
ok $tmp eq $cb;
$alpm->set_logcb(undef);
ok !defined $alpm->get_logcb;
done_testing;
t/preptests.pl view on Meta::CPAN
use strict;
use Cwd;
use English qw(-no_match_vars);
use File::Find;
use File::Copy;
use File::Path qw(make_path remove_tree);
use File::Spec::Functions qw(rel2abs catfile);
use File::Basename qw(dirname);
my $PROG = 'preptests';
my $REPODIR = 'repos';
## Variables inside the test.conf need absolute paths, assigned later.
my ($REPOSHARE, $TESTROOT);
my $TESTCONF = 'test.conf';
sub createconf
{
my($path, $root, $repos) = @_;
open my $of, '>', $path
or die "failed to open t/test.conf file: $!";
print $of <<"END_CONF";
[options]
RootDir = $root
DBPath = $root/db
CacheDir = $root/cache
LogFile = $root/test.log
#GPGDir = $root/gnupg/
HoldPkg = pacman glibc
SyncFirst = pacman
#XferCommand = /usr/bin/curl -C - -f %u > %o
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
t/preptests.pl view on Meta::CPAN
sub mkroot
{
remkdir($TESTROOT);
my @dirs = glob("$TESTROOT/{gnupg,cache,{db/{local,cache}}}");
make_path(@dirs, { mode => 0755 });
}
sub corruptpkg
{
my $fqp = "$REPOSHARE/simpletest/corruptme-1.0-1-any.pkg.tar.xz";
unlink $fqp or die "unlink: $!";
open my $fh, '>', $fqp or die "open: $!";
print $fh "HAHA PWNED!\n";
close $fh or die "close: $!";
return;
}
sub buildrepos
t/preptests.pl view on Meta::CPAN
$REPOSHARE = rel2abs('repos/share');
$TESTROOT = rel2abs('root');
unless(-d $REPOSHARE){
my $repos = buildrepos($REPOSHARE);
createconf($TESTCONF, $TESTROOT, $repos);
}
#corruptpkg();
# Allows me to tweak the test.conf file and not have it overwritten...
mkroot();
return 0;
}
exit main(@ARGV);
( run in 0.442 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )