From: Michael Tremer Date: Fri, 5 Jul 2024 15:32:45 +0000 (+0000) Subject: make.sh: Update the runtime after the interrupt X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b403507d1a36746076f265523210aa2719c7026;p=people%2Fms%2Fipfire-2.x.git make.sh: Update the runtime after the interrupt This is a lot better because this puts the code where it is being executed and allows us to run run_command in a subshell, too. Signed-off-by: Michael Tremer --- diff --git a/make.sh b/make.sh index 537bd2eba..12b3deff5 100755 --- a/make.sh +++ b/make.sh @@ -396,16 +396,8 @@ __timer() { } # Called when the timer triggers +# This function does nothing, but is needed interrupt the wait call __timer_event() { - local t - - # If we have a running process, we update the runtime - # every time this is being triggered - if [ -n "${TIMER}" ] && [ "${TIMER}" -gt 0 ]; then - # Print the runtime - print_runtime "${TIMER} - $(( SECONDS - TIMER ))" - fi - return 0 } @@ -832,10 +824,7 @@ run_command() { # If we are not running in quiet mode, we set the timer case "${quiet}" in false) - # Launch the timer launch_timer - - TIMER="${t}" ;; esac @@ -850,6 +839,13 @@ run_command() { # If the return code is >= 128, wait has been interrupted by the timer if [ "$?" -ge 128 ]; then + # Update the runtime + case "${quiet}" in + false) + print_runtime "$(( SECONDS - t ))" + ;; + esac + continue fi @@ -858,9 +854,6 @@ run_command() { break done - # Clear the timer - TIMER=0 - # Show runtime and status unless quiet case "${quiet}" in false)