From 9b74f9ebc88ca9c722f8610aded571cd8d3535e4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 30 Dec 2009 22:16:33 +0100 Subject: [PATCH] Added new var "build_wrksrc" for use in templates. This var sets a relative path to $wrksrc that is used to configure/build/install a package. --HG-- extra : convert_revision : 690f4d435f3d4e6a9228f7f5f09ecf8b490a273a --- xbps-src/shutils/build_funcs.sh | 3 ++- xbps-src/shutils/configure_funcs.sh | 3 ++- xbps-src/shutils/install_funcs.sh | 2 ++ xbps-src/shutils/tmpl_funcs.sh | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index 5d7d94c32a8..866570edd0e 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 1d74c3e0a1a..be8fdb75cf6 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 c39ee064dd9..c7a8bd979a4 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 ac5ce477172..1e6fb1454fc 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"