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 <jan.steffens@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
e68e994eb2
commit
14474a32c9
1 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue