diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 8f56c9b49b5..4afcac16c12 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -175,12 +175,14 @@ fi case "$target" in build|configure) . $XBPS_SHUTILSDIR/tmpl_funcs.sh - setup_tmpl $(basename_cwd) + [ ! -r ./template ] && msg_error "missing build template file." + . ./template if [ -z "$base_chroot" -a -z "$in_chroot" ]; then . $XBPS_SHUTILSDIR/chroot.sh - xbps_chroot_handler $target $pkgname + xbps_chroot_handler $target $(basename_cwd) else + setup_tmpl $(basename_cwd) . $XBPS_SHUTILSDIR/fetch_funcs.sh fetch_distfiles if [ ! -f "$XBPS_EXTRACT_DONE" ]; then