diff options
Diffstat (limited to 'arch-nspawn.in')
-rw-r--r-- | arch-nspawn.in | 15 |
1 files changed, 10 insertions, 5 deletions
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 \ |