makechrootpkg: Allow specifying cache dir

This commit is contained in:
Kevin Mihelich 2014-12-28 22:25:58 -07:00 committed by Martchus
parent 6d0ac6b9a8
commit 0ed93d467e
1 changed files with 4 additions and 2 deletions

View File

@ -67,6 +67,7 @@ usage() {
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
echo '-C <dir> Set pacman cache to pass to arch-nspawn'
echo '-d <dir> Bind directory into build chroot as read-write'
echo '-D <dir> 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