diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index 5d7d94c32a..866570edd0 100644 --- a/xbps-src/shutils/build_funcs.sh +++ b/xbps-src/shutils/build_funcs.sh @@ -43,7 +43,8 @@ build_src_phase() [ ! -d $wrksrc ] && msg_error "unexistent build directory [$wrksrc]" - cd $wrksrc || exit 1 + cd $wrksrc || return 1 + [ -n "$build_wrksrc" ] && cd $build_wrksrc || return 1 [ -n "$revision" ] && pkg="${pkg}_${revision}" diff --git a/xbps-src/shutils/configure_funcs.sh b/xbps-src/shutils/configure_funcs.sh index 1d74c3e0a1..be8fdb75cf 100644 --- a/xbps-src/shutils/configure_funcs.sh +++ b/xbps-src/shutils/configure_funcs.sh @@ -68,7 +68,8 @@ configure_src_phase() [ -z "$configure_script" ] && configure_script="./configure" - cd $wrksrc || exit 1 + cd $wrksrc || return 1 + [ -n "$build_wrksrc" ] && cd $build_wrksrc || return 1 . $XBPS_SHUTILSDIR/buildvars_funcs.sh set_build_vars diff --git a/xbps-src/shutils/install_funcs.sh b/xbps-src/shutils/install_funcs.sh index c39ee064dd..c7a8bd979a 100644 --- a/xbps-src/shutils/install_funcs.sh +++ b/xbps-src/shutils/install_funcs.sh @@ -71,6 +71,8 @@ install_src_phase() saved_wrksrc=$wrksrc cd $wrksrc || msg_error "can't change cwd to wrksrc!" + [ -n "$build_wrksrc" ] && cd $build_wrksrc \ + || msg_error "can't change cwd to build_wrksrc!" # Run pre_install func. run_func pre_install || msg_error "pre_install stage failed!" diff --git a/xbps-src/shutils/tmpl_funcs.sh b/xbps-src/shutils/tmpl_funcs.sh index ac5ce47717..1e6fb1454f 100644 --- a/xbps-src/shutils/tmpl_funcs.sh +++ b/xbps-src/shutils/tmpl_funcs.sh @@ -75,7 +75,7 @@ reset_tmpl_vars() only_for_archs conf_files keep_libtool_archives \ noarch subpackages sourcepkg gtk_iconcache_dirs \ abi_depends api_depends triggers openrc_services \ - replaces system_accounts \ + replaces system_accounts build_wrksrc \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE FILESDIR DESTDIR \ SRCPKGDESTDIR PATCHESDIR"