Arch::Registry(3pm) | User Contributed Perl Documentation | Arch::Registry(3pm) |
Arch::Registry - manage registered archives, search archives on the web
use Arch::Registry; my $registry = Arch::Registry->new; my %archive_locations = $registry->registered_archives; $registry->register_archive('http://john.com/archives/main'); $registry->unregister_archive('john@mail.com--tux'); %archive_locations = $registry->supermirror_archives; die $registry->web_error if $registry->web_error; my @john_versions = @{ $registry->supermirror_archive_versions->{'john@mail.com--tux') }; my $archives = $registry->search_supermirror('.*', '--cset-gui--'); die $registry->web_error unless defined $archives; my $versions = $registry->search_supermirror('john@', '^tla\b', 1); print map { "$_\n" } @$versions; # print john@mail.com--tux/tla...
This class provides the way to register and unregister GNU Arch archives for the caller user and list all registered archives. It also provides the way to search the supermirror (currently mirrors.sourcecontrol.net) by archive name or archive/category/branch/version regexp.
The following class methods are available:
new, register_archive, unregister_archive, registered_archives, set_web_cache, flag_web_cache, supermirror_archives, supermirror_archive_versions, search_supermirror, web_error.
The keys of named-values are dir (the web cache directory) and ttl (time to live in minutes). If named-values is empty or misses dir, or dir does not exist, the cache is unset.
This method has a side effect of forgetting memoized real-web-or-cache content fetches. So you may call it with or without parameters to reset the memoized values, although this should rarely be needed.
value may be "enabled", "disabled", "nowrite" and "noread". Additionally, the false value will be taken as "disabled", the true value as "enabled".
If return_versions is unset, returns arrayref that is all matching [ archive, .. ]. If return_versions is set to 'joined', returns arrayref that is all matching [ archive/version, .. ]. If return_versions is set to 'hashref', returns hashref similar to supermirror_archive_versions that is all matching { archive => [ version, .. ], ... }.
If web_error occurred, returns undef.
archive_regexp defaults to "any", version_regexp defaults to "any", return_versions defaults to false.
Waiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
For more information, see tla, Arch::Util, Arch::LiteWeb.
2005-05-13 | perl v5.20.2 |