From 6baa28a6e34c0f9c0f1f3eedcc50cc1aa092d78b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 29 Apr 2010 16:04:09 +0200 Subject: [PATCH] Redirect stderr to a file in ${wrksrc} for run_func(). So that you can use 'set -x' in a template and see the output. --HG-- extra : convert_revision : 7b3225b2ed3f1fab410c43af12f5d5f66f8504d7 --- xbps-src/libexec/xbps-src-doinst-helper.sh.in | 18 ++++++++++++------ xbps-src/shutils/build_funcs.sh | 12 ++++++++---- xbps-src/shutils/configure_funcs.sh | 6 ++++-- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/xbps-src/libexec/xbps-src-doinst-helper.sh.in b/xbps-src/libexec/xbps-src-doinst-helper.sh.in index c6bc892c09..7158ff720c 100644 --- a/xbps-src/libexec/xbps-src-doinst-helper.sh.in +++ b/xbps-src/libexec/xbps-src-doinst-helper.sh.in @@ -89,26 +89,31 @@ install_src_phase() fi # Run pre_install func. - run_func pre_install 2>/dev/null || msg_error "pre_install stage failed!" + run_func pre_install 2>${wrksrc}/.xbps_pre_install.log \ + || msg_error "pre_install stage failed!" msg_normal "Running install phase for $pkgname-$lver." # Type of installation: custom, make or python. case "$build_style" in custom-install) - run_func do_install 2>/dev/null || msg_error "do_install stage failed!" + run_func do_install 2>${wrksrc}/.xbps_do_install.log \ + || msg_error "do_install stage failed!" ;; python-module) . $XBPS_HELPERSDIR/python-module.sh - run_func do_install 2>/dev/null || msg_error "python module install failed!" + run_func do_install 2>${wrksrc}/.xbps_do_install.log \ + || msg_error "python module install failed!" ;; *) - make_install $lver + make_install $lver 2>${wrksrc}/.xbps_make_install.log ;; esac + cd ${wrksrc} || msg_error "can't change cwd to wrksrc!" # Run post_install func. - run_func post_install 2>/dev/null || msg_error "post_install stage failed!" + run_func post_install 2>${wrksrc}/.xbps_post_install.log \ + || msg_error "post_install stage failed!" # Remove libtool archives by default. if [ -z "$keep_libtool_archives" ]; then @@ -153,7 +158,8 @@ install_src_phase() . $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template pkgname=${subpkg} set_tmpl_common_vars - run_func do_install 2>/dev/null || \ + run_func do_install \ + 2>${wrksrc}/.xbps_do_install_${pkgname}.log || \ msg_error "$pkgname do_install stage failed!" done diff --git a/xbps-src/shutils/build_funcs.sh b/xbps-src/shutils/build_funcs.sh index 642e2aa4ca..fa12db056e 100644 --- a/xbps-src/shutils/build_funcs.sh +++ b/xbps-src/shutils/build_funcs.sh @@ -57,7 +57,8 @@ build_src_phase() makejobs="-j$XBPS_MAKEJOBS" fi # Run pre_build func. - run_func pre_build 2>/dev/null || msg_error "pre_build stage failed!" + run_func pre_build 2>${wrksrc}/.xbps_pre_build.log \ + || msg_error "pre_build stage failed!" . $XBPS_SHUTILSDIR/buildvars_funcs.sh set_build_vars @@ -65,17 +66,20 @@ build_src_phase() msg_normal "Running build phase for $pkg." if [ "$build_style" = "custom-install" ]; then - run_func do_build 2>/dev/null || msg_error "do_build stage failed!" + run_func do_build 2>${wrksrc}/.xbps_do_build.log \ + || msg_error "do_build stage failed!" else # # Build package via make. # - ${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} + ${make_cmd} ${makejobs} ${make_build_args} \ + ${make_build_target} 2>${wrksrc}/.xbps_make_build.log [ $? -ne 0 ] && msg_error "building $pkg (build phase)." fi # Run post_build func. - run_func post_build 2>/dev/null || msg_error "post_build stage failed!" + run_func post_build 2>${wrksrc}/.xbps_post_build.log \ + || msg_error "post_build stage failed!" unset makejobs diff --git a/xbps-src/shutils/configure_funcs.sh b/xbps-src/shutils/configure_funcs.sh index 1fc3cddb7e..d99a834e5d 100644 --- a/xbps-src/shutils/configure_funcs.sh +++ b/xbps-src/shutils/configure_funcs.sh @@ -58,7 +58,8 @@ configure_src_phase() cd $wrksrc || msg_error "unexistent build directory [$wrksrc]." # Run pre_configure func. - run_func pre_configure 2>/dev/null || msg_error "pre_configure stage failed!" + run_func pre_configure 2>${wrksrc}/.xbps_pre_configure.log \ + || msg_error "pre_configure stage failed!" # Export configure_env vars. for f in ${configure_env}; do @@ -114,7 +115,8 @@ configure_src_phase() fi # Run post_configure func. - run_func post_configure 2>/dev/null || msg_error "post_configure stage failed!" + run_func post_configure 2>${wrksrc}/.xbps_post_configure.log \ + || msg_error "post_configure stage failed!" # unset configure_env vars. for f in ${configure_env}; do