---
name: "Arch::Backend"
section: "3pm"
platform: "linux"
package: "libarch-perl"
version: "0.5.2-2"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/Arch::Backend"
---

# Arch::Backend(3pm)

Arch backend feature specific functions

## NAME

Arch::Backend - Arch backend feature specific functions

## SYNOPSIS

```
    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);
```

## DESCRIPTION

A set of helper functions suitable for GNU 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.

## FUNCTIONS

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

- **arch\_backend** \[*exe*\]

  Return or set the arch backend executable, like "/opt/bin/tla" or "baz-1.3".

  By default, the arch backend executable is taken from environment variable `$ARCH_BACKEND` (or `$TLA`, or `$BAZ`). If no environment variable is set, then "tla" is used.

- **arch\_backend\_name**

  Return the brand name of the arch backend, "tla" or "baz".

- **arch\_backend\_version**

  Return the arch backend version, like "1.3.1".

- **is\_tla**

  Return true if **arch\_backend\_name** is "tla".

- **is\_baz**

  Return true if **arch\_backend\_name** is "baz".

- **has\_archive\_setup\_cmd**

  Return true if the arch backend has "archive-setup" command. baz removed this command.

- **has\_file\_diffs\_cmd**

  Return true if the arch backend has "file-diffs" command. It was renamed to "file-diff" in tla-1.3.

- **has\_register\_archive\_name\_arg**

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

- **has\_tree\_version\_dir\_opt**

  Return true if the arch backend's "tree-version" command supports "-d" options. This is true for baz.

- **has\_tree\_id\_cmd**

  Return true if the arch backend has "tree-id" command. This is true for baz.

- **has\_set\_tree\_version\_cmd**

  Return true if the arch backend has "set-tree-version" command. baz removed this command and merged it into "tree-version".

- **has\_cache\_feature**

  Return true if the arch backend supports Arch Cache feature. This is true for baz.

- **get\_cache\_config**

  Return hash with the following keys: dir - directory of the local cache (or undef if not applicable).

- **has\_commit\_version\_arg**

  Return true if the arch backend's "commit" command supports version argument. baz-1.4 removed this functionality.

- **has\_commit\_files\_separator**

  Return true if the arch backend's "commit" command requires "--" argument to separate files. baz-1.4 removed this separator.

- **has\_revlib\_patch\_set\_dir**

  Return true if the arch backend's creates ,,patch-set subdirectory in revision library. baz-1.4 removed this functionality.

## BUGS

This module uses heuristics and does not (intend to) provide the perfect information. Requires constant updating.

## AUTHORS

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

## SEE ALSO

For more information, see tla, baz, Arch.
