Arch::Backend(3pm)

πŸ“¦ version 0.5.2, in ubuntu jammy

πŸ’– Arch::Backend β€” the manual, but make it cute ✨

okay bestie, so this is Arch::Backend from the User Contributed Perl Documentation, and it's basically the backstage crew for GNU Arch stuff in Perl. manual name is Arch::Backend(3pm) if you needed it for the group chat receipts πŸŽ€


🌸 NAME 🌸

Arch::Backend β€” Arch backend feature specific functions. that's it, that's the whole name, she's straightforward and I respect it πŸ’…


✨ SYNOPSIS ✨

here's the vibe, copy-paste ready:

use Arch::Backend qw(arch_backend is_baz has_file_diffs_cmd);

my $exe = arch_backend();
print "Not in tree, try '$exe init-tree'\n";

my $version = Arch::Backend::arch_backend_version;
print "Using baz $version as a backend\n" if is_baz();

my $cmd = has_file_diffs_cmd()
    ? "file-diffs"
    : "file-diff";
Arch::Util::run_tla($cmd, $filename);

like. look at that. it's giving competence πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

so it's a lil set of helper functions, and they're made for GNU Arch related projects written in Perl. that's the whole job description.

the higher, object oriented levels of the Arch/Perl library are the ones that actually call these helpers β€” they use them to ask questions about the actual arch backend being used, stuff like "hey do you support this incompatible feature or not" πŸ‘‘ so these functions are basically the backend's little info desk, and everything upstairs relies on them.


πŸ’… FUNCTIONS πŸ’…

here's the full roster, no gatekeeping, all of them:

arch_backend, arch_backend_name, arch_backend_version, is_tla, is_baz, has_archive_setup_cmd, has_file_diffs_cmd, has_register_archive_name_arg, has_tree_version_dir_opt, has_tree_id_cmd, has_set_tree_version_cmd, has_cache_feature, get_cache_config, has_commit_version_arg, has_commit_files_separator, has_revlib_patch_set_dir.

and now the individual rundowns bestie, buckle up πŸ“

  • arch_backend [exe] β€” returns or sets the arch backend executable, like "/opt/bin/tla" or "baz-1.3". by default the arch backend executable comes from the environment variable $ARCH_BACKEND (or $TLA, or $BAZ). if literally no environment variable is set, then "tla" is used. so she has a fallback, she's prepared πŸ’œ
  • arch_backend_name β€” returns the brand name of the arch backend, so either "tla" or "baz". yes it's a name reveal moment.
  • arch_backend_version β€” returns the arch backend version, like "1.3.1". slay.
  • is_tla β€” returns true if arch_backend_name is "tla".
  • is_baz β€” returns true if arch_backend_name is "baz". the two of them are lowkey in competition, we don't pick sides 🫢
  • has_archive_setup_cmd β€” returns true if the arch backend has the "archive-setup" command. baz removed this command. rip archive-setup, you were iconic 😭
  • has_file_diffs_cmd β€” returns true if the arch backend has the "file-diffs" command. it was renamed to "file-diff" in tla-1.3. the way that names keep changing, I can't πŸ’€
  • has_register_archive_name_arg β€” returns true if the arch backend's "register-archive" command supports two positional arguments, one of which is archive name. baz-1.3 removed such syntax. the previous baz versions supported this syntax, but it was useless, since the archive was accessed anyway. so like, it worked but did nothing, which is honestly so real of it πŸ™ˆ
  • has_tree_version_dir_opt β€” returns true if the arch backend's "tree-version" command supports -d options. this is true for baz. bestie loves a -d.
  • has_tree_id_cmd β€” returns true if the arch backend has the "tree-id" command. this is true for baz.
  • has_set_tree_version_cmd β€” returns true if the arch backend has the "set-tree-version" command. baz removed this command and merged it into "tree-version". consolidation era ✨
  • has_cache_feature β€” returns true if the arch backend supports the Arch Cache feature. this is true for baz.
  • get_cache_config β€” returns a hash with the following keys: dir β€” directory of the local cache (or undef if not applicable). so if it's not applicable you get undef, not a crash, which is very demure, very mindful 🌈
  • has_commit_version_arg β€” returns true if the arch backend's "commit" command supports version argument. baz-1.4 removed this functionality. </3
  • has_commit_files_separator β€” returns true if the arch backend's "commit" command requires "--" argument to separate files. baz-1.4 removed this separator. the -- was a whole era fr fr.
  • has_revlib_patch_set_dir β€” returns true if the arch backend's creates ,,patch-set subdirectory in revision library. baz-1.4 removed this functionality. she's messy but she's trying.

πŸ’€ BUGS πŸ’€

okay so. this module uses heuristics and does not (intend to) provide the perfect information. requires constant updating.

so like, it guesses, and it's honest about guessing, and you have to keep feeding it updates forever. not me relating to this on a spiritual level 😭 but also please update it, bestie.

🧚 AUTHORS 🧚

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


⭐ SEE ALSO ⭐

for more information, see tla, baz, Arch. iykyk πŸ’–


and that's the whole thing babes β€” this page is perl v5.20.2, dated 2005-10-23, so shoutout to the archivists keeping the receipts, periodt πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from