From 7f1704fcd9ad4d721fa285eaf3d66d99f4c7dce1 Mon Sep 17 00:00:00 2001 From: deusstultus Date: Sat, 12 May 2018 14:53:41 -0500 Subject: [PATCH] Modify host_mirror to allow simplified mirrors Current assumption is that all repositories follow "archlinux/$repo/os/$arch" and will fail to sed off the devtools package from the URL if this pattern is not matched. This patch will first remove the package tarball from the path before applying the replacement Signed-off-by: deusstultus --- arch-nspawn.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch-nspawn.in b/arch-nspawn.in index 7a7a274..49c9c36 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -59,7 +59,7 @@ else fi # shellcheck disable=2016 -host_mirror=$(pacman --cachedir /doesnt/exist -Sddp extra/devtools 2>/dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#') +host_mirror=$(pacman --cachedir /doesnt/exist -Sddp extra/devtools 2>/dev/null | sed -e 's#/[^/]*$##' -r -e 's#(.*/)extra/os.*#\1$repo/os/$arch#') # shellcheck disable=2016 [[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g') -- 2.17.0