From efdad1a3d707cc2a701e66d2823c2ff6b1c0fc95 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Sun, 5 Jun 2022 00:59:49 +0300
Subject: [PATCH] common: pacman.conf: remove nonexistent cache dirs

Other than avoiding the conditional logic there's no reason to specify
/srv/ftp/pool/{packages,community} as additional cache directories for
all servers.

Restoring the default CacheDir value on machines without a local mirror
allows us to use pacdiff to perform a three-way merge of the few config
files which are easier to rebase this way.
---
 roles/common/templates/pacman.conf.j2 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/roles/common/templates/pacman.conf.j2 b/roles/common/templates/pacman.conf.j2
index 3fc263daa..2f589852f 100644
--- a/roles/common/templates/pacman.conf.j2
+++ b/roles/common/templates/pacman.conf.j2
@@ -11,7 +11,11 @@
 # If you wish to use different paths, uncomment and update the paths.
 #RootDir     = /
 #DBPath      = /var/lib/pacman/
+{% if 'mirrors' in group_names or inventory_hostname in ['gemini.archlinux.org', 'build.archlinux.org'] %}
 CacheDir     = /var/cache/pacman/pkg/ /srv/ftp/pool/packages/ /srv/ftp/pool/community/
+{% else %}
+#CacheDir    = /var/cache/pacman/pkg/
+{% endif %}
 #LogFile     = /var/log/pacman.log
 #GPGDir      = /etc/pacman.d/gnupg/
 #HookDir     = /etc/pacman.d/hooks/
-- 
GitLab