Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Yan <felixonmars@archlinux.org>2024-03-30 06:18:07 +0200
committerChristian Heusel <christian@heusel.eu>2024-04-28 17:06:46 +0200
commite828111ff7094354da6d55e1bc19d2d8decf3d6d (patch)
treeee2793309a2f83aa6870ade09938929d5e2c23af
parent35b417d226fc3d11ac0015abdcb3594d2c696c2e (diff)
feat(arch-nspawn): add support for pacman CacheServer
pacman 6.1 added support for CacheServer which allows us to download packages faster and reduce the burden on tier0 server. They won't be used to fetch databases so it should be pretty safe in the repository consistency context. Component: arch-nspawn
-rw-r--r--src/arch-nspawn.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in
index 2318813..a4504a1 100644
--- a/src/arch-nspawn.in
+++ b/src/arch-nspawn.in
@@ -72,6 +72,7 @@ fi
# shellcheck disable=2016
host_mirrors=($(pacman-conf --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
+host_cachemirrors=($(pacman-conf --repo extra CacheServer 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
for host_mirror in "${host_mirrors[@]}"; do
if [[ $host_mirror == *file://* ]]; then
@@ -106,6 +107,8 @@ copy_hostconf () {
printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
+ [[ -n $host_cachemirrors ]] && printf 'CacheServer = %s\n' "${host_cachemirrors[@]}" >>"$working_dir/etc/pacman.d/mirrorlist"
+
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"