From f85a58a0a630d44285532693b61d4b8a58dee495 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 2 Oct 2019 11:21:33 -0400 Subject: arch-nspawn: rely on deduplication to avoid making multiple host_mirror mounts Instead of comparing exact mirror urls to see if they are in host_mirrors in order to "skip" the official mirrors Signed-off-by: Eli Schwartz --- arch-nspawn.in | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index 7aa6fd6..198d227 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -75,15 +75,13 @@ done 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 + --repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1#') + for line in "${lines[@]}"; do + if [[ $line = file://* ]]; then + line=${line#file://} + in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line") + fi + done done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list) mount_args+=("--bind=${cache_dirs[0]//:/\\:}") -- cgit v1.2.3-70-g09d2