From c36ab218239791866daa032545904bbfe14567da Mon Sep 17 00:00:00 2001 From: Matthias Dienstbier Date: Thu, 11 Mar 2010 19:46:41 +0100 Subject: revert _dia_follow_progress Bash would wait for the termination of dialog which will never happen because of the command substitution. This is more or less a revert of commit http://projects.archlinux.org/aif.git/commit/?id=7eeddbe6301fb3979a55f1e74a0a0e16ec566df4, but only for _dia_follow_progress --- lib-ui.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib-ui.sh b/lib-ui.sh index b188c7a..94cda28 100644 --- a/lib-ui.sh +++ b/lib-ui.sh @@ -419,7 +419,9 @@ _dia_follow_progress () title=$1 logfile=$2 - FOLLOW_PID=$(_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0) + _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 >$RUNTIME_DIR/aif-follow-pid + FOLLOW_PID=`cat $RUNTIME_DIR/aif-follow-pid` + rm $RUNTIME_DIR/aif-follow-pid # I wish something like this would work. anyone who can explain me why it doesn't get's to be aif contributor of the month. # FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null | head -n 1` @@ -427,6 +429,10 @@ _dia_follow_progress () # Also this doesn't work: # _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 &>/dev/null & # FOLLOW_PID=$! + + # Also the new stdout-stderr-swapping isn't a clean solution for that. When command substitition is used bash will + # wait until the command terminates, dialog's forking to background will fail. + # FOLLOW_PID=$(_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0) } -- cgit v1.2.2