From 69112171e5de910331e46cf3f848866550125024 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 28 Mar 2019 16:38:50 -0400 Subject: arch-nspawn: support bind-mounting custom file:/// repositories Fixes FS#45882 Signed-off-by: Eli Schwartz Signed-off-by: Levente Polyak --- arch-nspawn.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index c2bce76..5bc8e79 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -61,6 +61,19 @@ fi # shellcheck disable=2016 host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) +while read -r line; do + mapfile -t lines < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" \ + --repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1$repo/os/$arch#') + if [[ ${lines[0]} != ${host_mirrors[0]} ]]; then + for line in "${lines[@]}"; do + if [[ $line = file://* ]]; then + line=${line#file://} + in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line") + fi + done + fi +done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list) + # {{{ functions build_mount_args() { declare -g mount_args=() -- cgit v1.2.3-54-g00ecf