diff --git a/makechrootpkg.in b/makechrootpkg.in index ce47b93..f458d74 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -61,6 +61,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' @@ -296,12 +297,13 @@ move_products() { } # }}} -while getopts 'hcur:I:l:nTD:d:U:' arg; do +while getopts 'hcuC:r:I:l:nTD:d:U:' arg; do case "$arg" in c) clean_first=1 ;; D) bindmounts_ro+=("--bind-ro=$OPTARG") ;; d) bindmounts_rw+=("--bind=$OPTARG") ;; u) update_first=1 ;; + C) cache_dir="$OPTARG" ;; r) passeddir="$OPTARG" ;; I) install_pkgs+=("$OPTARG") ;; l) copy="$OPTARG" ;; @@ -386,7 +388,7 @@ download_sources prepare_chroot -if arch-nspawn "$copydir" \ +if arch-nspawn $cache_dir "$copydir" \ --bind="${PWD//:/\\:}:/startdir" \ --bind="${SRCDEST//:/\\:}:/srcdest" \ "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \