NAME
PPM::Repositories - List of Perl Package Manager repositories
SYNOPSIS
# Print all repositories for all architectures
use PPM::Repositories qw(get list used_archs);
for my $arch (used_archs()) {
print "$arch\n";
for my $name (list($arch)) {
my %repo = get($name, $arch);
next unless $repo{packlist};
print " $name\n";
for my $field (sort keys %repo) {
printf " %-12s %s\n", $field, $repo{$field};
}
}
}
DESCRIPTION
This module contains a list of PPM repositories for Perl 5.6 and later. For backwards compatibility reasons it exposes the data in 2 different mechanism.
The new interface uses API functions and is supplied for the benefit of PPM version 4 and later. The old interface directly exposes the %Repositories hash and should be used for PPM version 2 and 3.
The new interface
The "new" interface is aimed primarily at PPM version 4 users, but also contains information about Perl 5.6 and 5.8 repositories that can be used by PPM version 2 and 3.
- get(NAME, ARCH)
-
The get() function returns a hash describing the NAME repository for architecture ARCH. It looks like this:
( home => 'http://cpan.example.com/', desc => 'Example Repository', packlist => 'http://cpan.example.com/PPMPackages/10xx/', packlist_noarch => 'http://cpan.example.com/PPMPackages/noarch/', )
The
home
key provides a URL that will display additional information about the repository in a browser (for human consumption, not structured data for any tools).The
desc
key contains a description string, giving either a more verbose description of the repository host, or an indication of the provided content for more specialized repositories (e.g."gtk2-perl bindings"
).The
packlist
key will point to the repository for the architecture ARCH and will only be defined if the repository supports this architecture. Similarly thepacklist_noarch
key may point to an architecture-independent repository hosted by the same system. Either or both ofpacklist
andpacklist_noarch
may be undefined.ARCH will default to the current Perl version and architecture (it is the same as $Config{archname} under Perl 5.6, and has the major Perl version appended for later versions, such as "$Config{archname}-5.8" for Perl 5.8).
The get() function will return an empty list if the repository NAME does not exist at all.
- list(ARCH)
-
The list() function returns a list of names for all repositories that contain modules for architecture ARCH. This will include all repositories providing architecture-independent modules as well.
ARCH will default to the current Perl version and architecture.
- used_archs()
-
This function returns a list of all architectures that have at least one repository recorded in this module. This list will include the pseudo-architecture
noarch
for architecture-independent modules.
The old interface
The "old" interface is supported mainly for backwards compatibility. It uses the old structure layout, and continues to list SOAP style repositories (called "PPMServer") that are no longer supported in PPM version 4.
- %Repositories
-
An example entry in %Repositories looks like:
bribes => { location => 'http://www.bribes.org/perl/ppm/', Type => 'Webpage', Active => 1, Notes => 'Digest::*, Net::Pcap, Win32::* ...', PerlV => [ 5.6, 5.8 ], PerlO => ['MSWin32'], },
The meaning of the key/value pairs should be obvious.
Active is either 1, or 0, and it indicates whether or not that particular repository was reachable and contained ppm packages at the time this module was released.
PerlO is the value of $^O. See perlport for a list of values for this variable.
EXPORT
%Repositories is exported by default.
get(), list(), and used_archs() are only exported on demand.
BUGS/ADDITIONS/ETC
Please use https://rt.cpan.org/NoAuth/Bugs.html?Dist=PPM-Repositories to report bugs, request additions etc.
AUTHOR
D.H. (PodMaster)
Maintained since 2008 by Jan Dubois <jand@activestate.com>
LICENSE
Copyright (c) 2003,2004,2005 by D.H. (PodMaster). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.