summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch-nspawn.in1
-rw-r--r--makechrootpkg.in13
2 files changed, 14 insertions, 0 deletions
diff --git a/arch-nspawn.in b/arch-nspawn.in
index e695a29..0b0dc68 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -105,6 +105,7 @@ elif [[ $(cat "$working_dir/.arch-chroot") != "$CHROOT_VERSION" ]]; then
fi
build_mount_args
+cache_dirs+=('/repo/')
copy_hostconf
eval "$(grep '^CARCH=' "$working_dir/etc/makepkg.conf")"
diff --git a/makechrootpkg.in b/makechrootpkg.in
index ccfe77f..4985172 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -223,6 +223,19 @@ builduser ALL = NOPASSWD: /usr/bin/pacman
EOF
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
+ if ! grep -q '^\[repo\]' "$copydir/etc/pacman.conf"; then
+ local line
+ line=$(grep -n '^\[' "$copydir/etc/pacman.conf" |grep -Fv ':[options]'|sed 's/:.*//;1q')
+ local ins='[repo]
+SigLevel = Optional TrustAll
+Server = file:///repo
+'
+ sed -i "${line}i${ins//$'\n'/\\n}" "$copydir/etc/pacman.conf"
+ fi
+ # Avoid having to use `pacman -Sy` to update [repo], as
+ # networking might be disabled inside of the chroot.
+ cp "$copydir/repo/repo.db" "$copydir/var/lib/pacman/sync/repo.db"
+
# This is a little gross, but this way the script is recreated every time in the
# working copy
{