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>
This commit is contained in:
parent
20eec484fa
commit
f85a58a0a6
|
@ -75,15 +75,13 @@ done
|
||||||
|
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
mapfile -t lines < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" \
|
mapfile -t lines < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" \
|
||||||
--repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1$repo/os/$arch#')
|
--repo $line Server | sed -r 's#(.*/)[^/]+/os/.+#\1#')
|
||||||
if [[ ${lines[0]} != ${host_mirrors[0]} ]]; then
|
for line in "${lines[@]}"; do
|
||||||
for line in "${lines[@]}"; do
|
if [[ $line = file://* ]]; then
|
||||||
if [[ $line = file://* ]]; then
|
line=${line#file://}
|
||||||
line=${line#file://}
|
in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line")
|
||||||
in_array "$line" "${cache_dirs[@]}" || cache_dirs+=("$line")
|
fi
|
||||||
fi
|
done
|
||||||
done
|
|
||||||
fi
|
|
||||||
done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list)
|
done < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" --repo-list)
|
||||||
|
|
||||||
mount_args+=("--bind=${cache_dirs[0]//:/\\:}")
|
mount_args+=("--bind=${cache_dirs[0]//:/\\:}")
|
||||||
|
|
Loading…
Reference in New Issue