[fix] Only call progress callback if arg passed

This commit is contained in:
William Wernert
2020-12-28 13:57:44 -05:00
parent 7050b1fce5
commit 1e0525b1ad

View File

@@ -158,14 +158,14 @@ wait_for_apt() {
local count=0 local count=0
while [[ "$count" -lt "$retry_count" ]]; do while [[ "$count" -lt "$retry_count" ]]; do
if __check_apt_lock; then if __check_apt_lock; then
if [ -z "$progress_callback" ]; then if [[ -z $progress_callback ]]; then
echo "$lock_msg" echo "$lock_msg"
echo "$retry_msg" echo "$retry_msg"
else else
$progress_callback "$retry_msg" $progress_callback "$retry_msg"
fi fi
else else
$progress_callback "$old_text" [[ -z $progress_callback ]] && $progress_callback "$old_text"
return 0 return 0
fi fi
sleep "$retry_timeout" sleep "$retry_timeout"