summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dienstbier <mdienstbier@googlemail.com>2010-03-11 19:46:41 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-03-24 15:44:48 +0100
commitc36ab218239791866daa032545904bbfe14567da (patch)
treeb2efe10a47ec2efcf698e93ee188e4e55b09a6fa
parentbe992145a5d868fe1fc9eab1c93c31eb283b2bc7 (diff)
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
-rw-r--r--lib-ui.sh8
1 files changed, 7 insertions, 1 deletions
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)
}