diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2019-03-28 16:38:50 -0400 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2019-08-09 19:41:52 +0200 |
commit | 69112171e5de910331e46cf3f848866550125024 (patch) | |
tree | cb1493387cd310c1ca94c99cc726fcf18367c498 | |
parent | c14338c0fe71a74f5e56b4f3af7c548fe0928e15 (diff) | |
download | devtools-69112171e5de910331e46cf3f848866550125024.tar.xz |
arch-nspawn: support bind-mounting custom file:/// repositories
Fixes FS#45882
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
-rw-r--r-- | arch-nspawn.in | 13 |
1 files changed, 13 insertions, 0 deletions
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=() |