ALPM
view release on metacpan or search on metacpan
lib/ALPM/Conf.pod view on Meta::CPAN
When an import argument is given then special magic is performed. The
argument should be the path to a pacman configuration file to load. This
.conf file is parsed by a newly created I<ALPM::Conf> instance. The result
of the parsing is stored in the importing package's namespace under the
name of the C<$alpm> scalar. See the synopsis for an example. If you are
not familiar, you can give import arguments the following ways:
# Using use:
use ALPM::Conf '/etc/pacman.conf';
# Require is more transparent:
require ALPM::Conf;
ALPM::Conf->import('/etc/pacman.conf');
# On the command-line (see perlrun(1) manpage):
perl -MALPM::Conf=/etc/pacman.conf -e '...'
=head1 SEE ALSO
L<ALPM>
t/repos/package.pl view on Meta::CPAN
{
my($pi) = @_;
return sprintf '%s-%s-%s.pkg.tar.xz',
map { $_->[0] } @{$pi}{qw/pkgname pkgver arch/};
}
sub buildpkg
{
my($pi, $pd, $td) = @_;
my $parentd = dirname($td);
remkdir($td);
system 'cp' => ('-R', $pd, $parentd);
if($?){
print STDERR "$PROG: failed to cp $pd to $parentd\n";
exit 1;
}
unlink("$td/.PKGINFO") or die "unlink: $!";
updatepi($pi, $td);
writepi($pi, "$td/.PKGINFO");
my $fname = pkgfname($pi);
my $oldwd = getcwd();
chdir $td or die "chdir: $!";
system qq{bsdtar -cf - .PKGINFO * | xz -z > ../$fname};
if($?){
printf STDERR "$PROG: xz returned %d\n", $? >> 8;
exit 1;
}
chdir $oldwd or die "chdir: $!";
return "$parentd/$fname";
}
sub dirsin
{
my($p) = @_;
opendir my $dh, $p or die "opendir $p: $!";
my @dirs = grep { !/^[.]/ && -d "$p/$_" } readdir $dh;
closedir $dh;
return @dirs;
}
( run in 0.261 second using v1.01-cache-2.11-cpan-4d50c553e7e )