slitaz-base-files rev 337
libtaz.sh: fix behavior of action when it has two or more arguments in form of `action 'Text %s' $var`
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Mar 22 04:32:12 2018 +0200 (2018-03-22) |
parents | c2f061e4dedc |
children | 777a5f5107c7 |
files | rootfs/lib/libtaz.sh |
line diff
1.1 --- a/rootfs/lib/libtaz.sh Tue Feb 06 23:22:43 2018 +0200 1.2 +++ b/rootfs/lib/libtaz.sh Thu Mar 22 04:32:12 2018 +0200 1.3 @@ -53,7 +53,7 @@ 1.4 status() { 1.5 local ret_code=$? 1.6 [ -n "$quiet" -a "$ret_code" -eq 0 ] && return 1.7 - [ -n "$quiet" ] && action "$saved_action" no-quiet 1.8 + [ -n "$quiet" ] && quiet='once' action "$saved_action" 1.9 1.10 case $ret_code in 1.11 0) local msg="$okmsg" color="$okcolor";; 1.12 @@ -249,8 +249,8 @@ 1.13 # Print current action 1.14 saved_action='' 1.15 action() { 1.16 - saved_action="$1" 1.17 - [ -n "$quiet" -a -z "$2" ] && return 1.18 + saved_action="$(_n "$@")" 1.19 + [ "$quiet" == 'yes' ] && return 1.20 local w c scol msg chars 1.21 # Translators: 'w' is the width the wider translated message ('[ Done ]' or '[ Failed ]') takes in a terminal; place here the number 1.22 w=$(_ 'w'); w=${w/w/10} 1.23 @@ -264,6 +264,7 @@ 1.24 raw|gtk|html) echo -n "$msg";; 1.25 *) echo -ne "\033[0;33m$msg\033[0m";; 1.26 esac 1.27 + quiet=${quiet/once/yes} 1.28 } 1.29 1.30 # Print long line as list item