diff --git a/src/makechrootpkg.in b/src/makechrootpkg.in
index 14b8f11..12d8873 100644
--- a/src/makechrootpkg.in
+++ b/src/makechrootpkg.in
@@ -67,6 +67,7 @@ usage() {
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
+ echo '-C
Set pacman cache to pass to arch-nspawn'
echo '-d Bind directory into build chroot as read-write'
echo '-D Bind directory into build chroot as read-only'
echo '-u Update the working copy of the chroot before building'
@@ -286,12 +287,13 @@ move_products() {
}
# }}}
-while getopts 'hcur:I:l:nCTD:d:U:x:' arg; do
+while getopts 'hcuY:r:I:l:nCTD:d:U:x:' arg; do
case "$arg" in
c) clean_first=1 ;;
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
d) bindmounts_rw+=("--bind=$OPTARG") ;;
u) update_first=1 ;;
+ Y) cache_dir="-c $OPTARG" ;;
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;
l) copy="$OPTARG" ;;
@@ -387,7 +389,7 @@ nspawn_build_args=(
"${bindmounts_rw[@]}"
)
-if arch-nspawn "$copydir" \
+if arch-nspawn $cache_dir "$copydir" \
"${nspawn_build_args[@]}" \
/chrootbuild "${makepkg_args[@]}"
then