diff --git a/archbuild.in b/archbuild.in
index 9c5d706d84b92d808710913009c23ff6e7d85521..cdfca59bc0bfb8721d695eb177fba0d2580b67b6 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -17,11 +17,13 @@ else
fi
chroots='/var/lib/archbuild'
clean_first=false
+update=true
usage() {
echo "Usage: $cmd [options] -- [makechrootpkg args]"
echo ' -h This help'
echo ' -c Recreate the chroot before building'
+ echo ' -U Do not update chroots before building'
echo ' -r
Create chroots in this directory'
echo ''
echo "Default makechrootpkg args: ${makechrootpkg_args[*]}"
@@ -31,9 +33,11 @@ usage() {
orig_argv=("$@")
-while getopts 'hcr:' arg; do
+while getopts 'hcr:U' arg; do
case "${arg}" in
c) clean_first=true ;;
+ U) update=false
+ makechrootpkg_args=(-n) ;;
r) chroots="$OPTARG" ;;
*) usage ;;
esac
@@ -67,7 +71,9 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
-M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" || abort
-else
+elif $update; then
+ msg "Updating chroot for [${repo}] (${arch})..."
+
lock 9 "${chroots}/${repo}-${arch}/root.lock" "Locking clean chroot"
arch-nspawn \
-C "@pkgdatadir@/pacman-${repo}.conf" \
diff --git a/zsh_completion.in b/zsh_completion.in
index 4c6dd99994b2edb819ed30355fbd311b2f8252b1..f9687d6ce8dc665ff2c93d849cfd2b76473518b8 100644
--- a/zsh_completion.in
+++ b/zsh_completion.in
@@ -4,6 +4,7 @@ m4_include(lib/valid-tags.sh)
_archbuild_args=(
'-c[Recreate the chroot before building]'
+ '-U[Do not update chroots before building]'
'-r[Create chroots in this directory]:base_dir:_files -/'
)