Arch::Registry(3pm)

πŸ“¦ version 0.5.2, in ubuntu jammy

πŸ’– Arch::Registry πŸ’–

okay bestie, so this is Arch::Registry β€” it's a Perl module (you'll see it in the manual as Arch::Registry(3pm), from the User Contributed Perl Documentation section, which is exactly where the cool stuff lives ngl). What does it do? It manages your registered archives and searches archives on the web. That's the whole vibe. 🌸


✨ NAME ✨

Arch::Registry β€” manage registered archives, search archives on the web πŸ¦‹


✨ SYNOPSIS ✨

here's the whole thing in action, no cap:

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...

look at her go πŸ’…


✨ DESCRIPTION ✨

so basically, this class is your girl for registering and unregistering GNU Arch archives for the caller user, plus listing all the registered archives you've got going on. πŸŽ€

and it also lets you search the supermirror (currently mirrors.sourcecontrol.net) β€” either by archive name, or by archive/category/branch/version regexp. iconic honestly. πŸ”₯


✨ METHODS ✨

here's the full lineup of class methods, all present and accounted for:

new, register_archive, unregister_archive, registered_archives, set_web_cache, flag_web_cache, supermirror_archives, supermirror_archive_versions, search_supermirror, web_error.


🌟 new

Constructs the Arch::Registry object. baby's first registry, literally. 🍼

🌟 register_archive location [archive]

Registers an archive at the given location, plus an optional archive name. If archive is missing, then the location is actually accessed to find out the archive name β€” yes, it goes and looks, it's doing the work for you bestie. Returns true on success. βœ…

🌟 unregister_archive archive

Unregisters an archive. Returns true on success. bye girl, we won't miss you πŸ’€ (jk, love u)

🌟 registered_archives

Returns a hash β€” or a hashref if you're in scalar context, she's flexible like that β€” of registered archives. That's pairs of archive => location. 🫢

🌟 set_web_cache [ named-values ]

Defines the web cache to use when doing operations on the supermirror. 🧚

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 doesn't exist β€” the cache gets unset. poof. πŸ™ˆ

⚠️ heads up bestie: this method has a side effect of forgetting memoized real-web-or-cache content fetches. So you can call it with or without parameters to reset those memoized values, although ngl this should rarely be needed.

🌟 flag_web_cache [value]

Turns the web cache on or off depending on the parameter. 🎚️

value may be "enabled", "disabled", "nowrite" and "noread". Also, a false value gets taken as "disabled", and a true value as "enabled". so you can just vibe with truthiness, she gets it.

🌟 supermirror_archives

Returns a hash (or a hashref in scalar context, again, versatile queen) of archives mirrored on the supermirror β€” that's pairs of archive => location. 🌈

🌟 supermirror_archive_versions

Returns a hashref of archives mirrored on the supermirror and all their versions. That's pairs of archive => [ version, .. ]. all of them. every single one. ⭐

🌟 search_supermirror

🌟 search_supermirror archive_regexp

🌟 search_supermirror archive_regexp version_regexp

🌟 search_supermirror archive_regexp version_regexp return_versions

Searches the archives (and possibly their branches/versions too) using the archive and version regular expressions you gave her. πŸ”

  • If return_versions is unset, returns an arrayref that is all matching [ archive, .. ].
  • If return_versions is set to 'joined', returns an arrayref that is all matching [ archive/version, .. ].
  • If return_versions is set to 'hashref', returns a hashref similar to supermirror_archive_versions, that is all matching { archive => [ version, .. ], ... }.

If a web_error occurred, returns undef. 😭

archive_regexp defaults to "any", version_regexp defaults to "any", return_versions defaults to false.

🌟 web_error

Returns the string containing the error from fetching one or another supermirror url (the last one, specifically). Returns undef if no error occured. πŸ™


✨ BUGS ✨

Waiting for your reports. πŸ‘€ (yes that's it. she's patient. she's waiting. slide into her DMs with those bugs.)


✨ AUTHORS ✨

Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). 🫑


✨ SEE ALSO ✨

For more information, see tla, Arch::Util, Arch::LiteWeb. go read those next bestie, iykyk πŸ“š


and that's the whole page, mwah πŸ’‹ β€” this was perl v5.20.2, dated 2005-05-13, and she's still serving Arch::Registry(3pm) realness. periodt. πŸ‘‘

πŸ“¦ where this page comes from