From 97466957a7d447d9fe2125e488d61e508359818d Mon Sep 17 00:00:00 2001 From: William Wernert Date: Mon, 28 Dec 2020 15:06:03 -0500 Subject: [PATCH] [fix] Fix text printed to whiptail progress bar --- salt/common/tools/sbin/so-common | 6 +++--- setup/so-functions | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 6cefb11dc..c71e9150c 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -147,8 +147,8 @@ wait_for_apt() { local retry_count=30 local retry_timeout='10s' local lock_msg="Could not acquire dpkg lock, waiting $retry_timeout for lock to release." - if [ -z "$progress_callback" ]; then - if [ -z "$progress_bar_text" ]; then + if [[ -z $progress_callback ]]; then + if [[ -z $progress_bar_text ]]; then local old_text="Installing..." else local old_text="$progress_bar_text" @@ -162,7 +162,7 @@ wait_for_apt() { if [[ -z $progress_callback ]]; then echo " $lock_msg" | tee -a "$setup_log" else - $progress_callback "$lock_msg (Attempt $count/$retry_count)" + $progress_callback "Could not acquire dpkg lock, waiting $retry_timeout ($count/$retry_count)" fi else [[ -z $progress_callback ]] || $progress_callback "$old_text" diff --git a/setup/so-functions b/setup/so-functions index 642d386fe..06dcd10de 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1927,7 +1927,8 @@ setup_salt_master_dirs() { set_progress_str() { local percentage_input=$1 - local progress_bar_text=$2 + progress_bar_text=$2 + export progress_bar_text if (( "$percentage_input" >= "$percentage" )); then percentage="$percentage_input"