summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-10-02 11:21:33 -0400
committerLevente Polyak <anthraxx@archlinux.org>2019-11-30 13:21:23 +0100
commitf85a58a0a630d44285532693b61d4b8a58dee495 (patch)
treee0e1906fdc8632ae9b3c22b8726d334f97f0a57a
parent20eec484fadd7212367749ee7cd37d3aa18e8c4e (diff)
downloaddevtools-f85a58a0a630d44285532693b61d4b8a58dee495.tar.xz
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 <eschwartz@archlinux.org>
-rw-r--r--arch-nspawn.in16
1 files 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]//:/\\:}")