7.2 Variables

This section lists some of the variables defined by the package manager that can be used in scripts. These variables usually cannot be defined by the user, so they are not part of the variables section above.

$cpt_version

Package manager version.

$cpt_confdir

Location of the CPT system configuration directory. This is usually either ‘/etc/cpt’ or ‘PREFIX/etc/cpt’.

$pkg_db

Location of the package database without the root (‘var/db/cpt/installed’).

$sys_db

Location of the package manager database, making use of the current ‘$CPT_ROOT’ (‘$CPT_ROOT/$pkg_db’). This is the database you probably want to use.

$cpt_base

Location of the file that defines the base packages.

If for some reason, your script interacts with the directories created and managed by the package manager you should use the following variables instead of the user assigned variables such as ‘$CPT_CACHE’ or ‘$CPT_TMPDIR’. The variables below are the ones used for package operations (which are assigned by using a combination of user-assigned values and their fallbacks).

$cac_dir

Cache directory used by the package manager.

$src_dir

Directory containing downloaded sources for packages.

$log_dir

Directory where logs are saved.

$bin_dir

Directory where built package tarballs are saved.

$tmp_dir

Temporary directory for the package manager operations.