From 9b9ad8567f1246322904ee2a603b7e6f7f69c768 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 13 Mar 2009 17:37:53 +0100 Subject: fix for kill dialogs forked process from the follow_progress call in wait_for --- src/core/libs/lib-misc.sh | 3 ++- src/core/libs/lib-software.sh | 4 ++-- src/core/libs/lib-ui.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 0b77d93..9ce0fd8 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -34,6 +34,7 @@ run_background () # wait until a process is done # $1 identifier. WARNING! see above +# $2 pid of a process to kill when done (optional). useful for dialog --no-kill --tailboxbg's pid. wait_for () { [ -z "$1" ] && die_error "wait_for needs an identifier to known on which command to wait!" @@ -43,7 +44,7 @@ wait_for () sleep 1 done - kill $(cat $ANSWER) #TODO: this may not work when mode = cli (<--i wrote this before i used tail -f --pid. i don't remember what i meant with it). TODO: huh?? ANSWER? + [ -n "$2" ] && kill $2 } diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index 51a6539..455a3cc 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -11,7 +11,7 @@ run_mkinitcpio() run_background mkinitcpio "chroot $var_TARGET_DIR /sbin/mkinitcpio -p kernel26" $TMP_MKINITCPIO_LOG follow_progress "Rebuilding initcpio images ..." $TMP_MKINITCPIO_LOG $BACKGROUND_PID - wait_for mkinitcpio + wait_for mkinitcpio $FOLLOW_PID target_special_fs off @@ -33,7 +33,7 @@ installpkg() { run_background pacman_installpkg "$PACMAN_TARGET --noconfirm -S $ALL_PACKAGES" $TMP_PACMAN_LOG #TODO: There may be something wrong here. See http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=f504e9ecfb9ecf1952bd8dcce7efe941e74db946 ASKDEV (Simo) follow_progress " Installing... Please Wait " $TMP_PACMAN_LOG $BACKGROUND_PID - wait_for pacman_installpkg + wait_for pacman_installpkg $FOLLOW_PID local _result='' diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 57c0383..dc207e6 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -460,7 +460,7 @@ _dia_follow_progress () { title=$1 logfile=$2 - _dia_DIALOG --title "$1" --no-kill --tailboxbg "$2" 0 0 2>$ANSWER + FOLLOW_PID=`_dia_DIALOG --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null` } -- cgit v1.2.3-54-g00ecf