From e5788047491a1b52ff267251d5dfc4565c48832f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 22 Jun 2017 10:55:51 +0200 Subject: separate mirrorlist for i686 and x86_64 --- arch-nspawn.in | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index e68e2e7..1d2b845 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -58,10 +58,15 @@ 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 + pacconf_cmd=$(command -v pacman-conf || command -v pacconf) # shellcheck disable=2016 -host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) -# shellcheck disable=2016 +host_mirrors=($($pacconf_cmd --conf=$pac_conf --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')) # {{{ functions build_mount_args() { @@ -83,7 +88,9 @@ build_mount_args() { copy_hostconf () { cp -a /etc/pacman.d/gnupg "$working_dir/etc/pacman.d" - printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist" + printf 'Server = %s\n' "${host_mirrors[@]}" | \ + 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" @@ -110,8 +117,6 @@ fi build_mount_args copy_hostconf -eval "$(grep -a '^CARCH=' "$working_dir/etc/makepkg.conf")" - [[ -z $nosetarch ]] || unset CARCH exec ${CARCH:+setarch "$CARCH"} systemd-nspawn -q \ -- cgit v1.2.3-54-g00ecf