Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/arch-nspawn.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-22 10:55:51 +0200
committerErich Eckner <git@eckner.net>2018-03-24 21:36:02 +0100
commita25b809889217e0c50d90aaecd3a762b712a4519 (patch)
tree0559b2ba77037f4c6a7378ce501ac92d810d57b6 /arch-nspawn.in
parent55108adfb006ae8833aad7553ea6e6825fa96b36 (diff)
separate mirrorlist for i686 and x86_64
Diffstat (limited to 'arch-nspawn.in')
-rw-r--r--arch-nspawn.in26
1 files changed, 23 insertions, 3 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index cf6c236..8e76120 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -58,9 +58,28 @@ else
cache_dirs=("$cache_dir")
fi
+if [[ -n $makepkg_conf ]]; then
+ eval "$(grep -a '^CARCH=' "$makepkg_conf")"
+else
+ eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
+fi
+
+if [[ "$CARCH" = 'i'*'86' ]]; then
+ host_mirror="$(
+ sed -n '
+ /^\s*Server\s*=/{
+ s/^.*=\s*//
+ s/\s*\(#.*\)\?$//
+ p
+ q
+ }' \
+ '/etc/pacman.d/mirrorlist32'
+ )"
+else
# shellcheck disable=2016
-host_mirror=$(pacman --cachedir /doesnt/exist -Sddp extra/devtools 2>/dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#;s#(.*/)[^/]+/extra/[^/]+#\1$arch/$repo#')
+ host_mirror=$(pacman --cachedir /doesnt/exist -Sddp extra/devtools 2>/dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#;s#(.*/)[^/]+/extra/[^/]+#\1$arch/$repo#')
# shellcheck disable=2016
+fi
[[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
# {{{ functions
@@ -80,7 +99,9 @@ build_mount_args() {
copy_hostconf () {
cp -a /etc/pacman.d/gnupg "$working_dir/etc/pacman.d"
- echo "Server = $host_mirror" >"$working_dir/etc/pacman.d/mirrorlist"
+ echo "Server = $host_mirror" | \
+ tee "$working_dir/etc/pacman.d/mirrorlist" > \
+ "$working_dir/etc/pacman.d/mirrorlist32"
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"
@@ -92,7 +113,6 @@ copy_hostconf () {
done
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf"
- eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")"
sed -i '/^Architecture = /s| auto$| '"$CARCH|" "$working_dir/etc/pacman.conf"
}
# }}}