Compare commits

...

2 Commits

Author SHA1 Message Date
Evangelos Foutras
113807dcfe Merge branch 'arch-nspawn-read-CacheDir-from-host' into 'master'
arch-nspawn: read CacheDir option from host's conf

See merge request archlinux/devtools!95
2025-07-26 10:04:23 +03:00
Evangelos Foutras
d0847a2a1c arch-nspawn: read CacheDir option from host's conf
This went unnoticed on build.archlinux.org until we tried switching away
from its local /srv/ftp/ mirror. With a remote mirror, the chroots would
ignore all the cached packages under /srv/ftp/pool/{packages,community}.

With the local file:// mirror gone, arch-nspawn wouldn't mount the cache
directories from the host into the chroot. The fix is to read the option
from the host's pacman.conf, instead of the one given to arch-nspawn and
the one existing inside the working directory.
2022-03-20 10:44:45 +02:00

View File

@@ -69,7 +69,7 @@ nspawn_args=(
)
if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
mapfile -t cache_dirs < <(pacman-conf CacheDir)
fi
# shellcheck disable=2016