From 14474a32c90b2202f1faf69ea20abbcdedfe4c29 Mon Sep 17 00:00:00 2001 From: Jan Steffens Date: Thu, 24 Mar 2011 13:30:15 +0100 Subject: Make log redirection saner My main motivation was to remove the "sync", which can stall for minutes on a busy machine (FS#23378). I also cleaned up the redirection. Signed-off-by: Jan Steffens Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index bb7616cf..eb7c3701 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -794,15 +794,15 @@ run_function() { # ensure overridden package variables survive tee with split packages logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX") mkfifo "$logpipe" - exec 3>&1 tee "$BUILDLOG" < "$logpipe" & - exec 1>"$logpipe" 2>"$logpipe" + local teepid=$! + restoretrap=$(trap -p ERR) trap 'error_function $pkgfunc' ERR - $pkgfunc 2>&1 + $pkgfunc &>"$logpipe" eval $restoretrap - sync - exec 1>&3 2>&3 3>&- + + wait $teepid rm "$logpipe" else restoretrap=$(trap -p ERR) -- cgit v1.2.3-55-g3dc8