Cache lists


A cache list is simply a file with suffix ".caches" that contains a list of caches. For instance, in a fresh directory, create a file test.caches

#
#  -- My test cache list
#
BU
Pacman
This lists two caches by their symbolic names, but they may be URLs or paths in your local file system, or SSH access strings, etc. It's just the same format that you specify a cache with on the command line. Now do
% pacman -allow trust-all-caches
% pacman -lc test.caches
Caches files thus let you group caches together and make hierarchies. Suppose, now, that you want to install a version of Python. First do
% pacman -d version -lc test.caches
to see the available versions. Then, to install version 2.2.3 for instance, just do
% pacman -get "test.caches:Python | version('2.2.3')"
Notice that there is a Python version 2.2.3 in both BU and Pacman. Pacman always takes the first package that meets the requirements in your list of caches. To confirm this, do
% pacman -l -d up
to see that the package updates from test.caches:BU. If you like, you can also specify a path through a hierarchy of caches to specify what you want. For example, if you want the Pacman cache copy of Python, do
% pacman -remove
% pacman -fetch test.caches:Pacman:Python
% pacman -l
and you'll see that you get one of the Python packages from the Pacman cache rather than the BU cache.


Pacman Headquarters