summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch-nspawn.in3
-rw-r--r--archbuild.in10
2 files changed, 11 insertions, 2 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index 8182120..56e75eb 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -93,6 +93,7 @@ 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"
}
# }}}
@@ -109,8 +110,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 \
diff --git a/archbuild.in b/archbuild.in
index 0ac3c29..0a84687 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -41,6 +41,14 @@ done
check_root SOURCE_DATE_EPOCH
+if [ "${arch}" = "x86_64" ]; then
+ cache_dir=''
+else
+ mkdir -p '/var/cache/archbuild32'
+ cache_dir='-c/var/cache/archbuild32'
+ makechrootpkg_args+=('-d/var/cache/archbuild32:/var/cache/pacman/pkg')
+fi
+
# Pass all arguments after -- right to makepkg
makechrootpkg_args+=("${@:$OPTIND}")
@@ -63,6 +71,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
setarch "${arch}" mkarchroot \
-C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \
+ ${cache_dir} \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
else
@@ -70,6 +79,7 @@ else
arch-nspawn \
-C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \
+ ${cache_dir} \
"${chroots}/${repo}-${arch}/root" \
pacman --arch ${arch} -Syu --noconfirm || abort
fi