Arch backend feature specific functions
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);
A set of helper functions suitable for \s-1GNU\s0 Arch related projects in Perl.
Higher (object oriented) levels of Arch/Perl library make use of these helper functions to query certain aspects (like incompatible features) of the actual arch backend used.
The following functions are available:
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.
Return or set the arch backend executable, like \*(L"/opt/bin/tla\*(R" or \*(L"baz-1.3\*(R". By default, the arch backend executable is taken from environment variable $ARCH_BACKEND (or $TLA, or $BAZ). If no environment variable is set, then \*(L"tla\*(R" is used.
Return the brand name of the arch backend, \*(L"tla\*(R" or \*(L"baz\*(R".
Return the arch backend version, like \*(L"1.3.1\*(R".
Return true if arch_backend_name is \*(L"tla\*(R".
Return true if arch_backend_name is \*(L"baz\*(R".
Return true if the arch backend has \*(L"archive-setup\*(R" command. baz removed this command.
Return true if the arch backend has \*(L"file-diffs\*(R" command. It was renamed to \*(L"file-diff\*(R" in tla-1.3.
Return true if the arch backend's \*(L"register-archive\*(R" 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.
Return true if the arch backend's \*(L"tree-version\*(R" command supports \*(L"-d\*(R" options. This is true for baz.
Return true if the arch backend has \*(L"tree-id\*(R" command. This is true for baz.
Return true if the arch backend has \*(L"set-tree-version\*(R" command. baz removed this command and merged it into \*(L"tree-version\*(R".
Return true if the arch backend supports Arch Cache feature. This is true for baz.
Return hash with the following keys: dir - directory of the local cache (or undef if not applicable).
Return true if the arch backend's \*(L"commit\*(R" command supports version argument. baz-1.4 removed this functionality.
Return true if the arch backend's \*(L"commit\*(R" command requires \*(L"--\*(R" argument to separate files. baz-1.4 removed this separator.
Return true if the arch backend's creates ,,patch-set subdirectory in revision library. baz-1.4 removed this functionality.
This module uses heuristics and does not (intend to) provide the perfect information. Requires constant updating.
Mikhael Goikhman ([email protected]\*(--Perl-GPL/arch-perl\*(--devel).
For more information, see tla, baz, Arch.