# HG changeset patch # User Aleksej Bobylev # Date 1521685932 -7200 # Node ID 69ad2183be35761cf3fbacc123f7a02170db2bf6 # Parent c2f061e4dedc77770f9e13083876d0b18723a07f libtaz.sh: fix behavior of action when it has two or more arguments in form of `action 'Text %s' $var` diff -r c2f061e4dedc -r 69ad2183be35 rootfs/lib/libtaz.sh --- a/rootfs/lib/libtaz.sh Tue Feb 06 23:22:43 2018 +0200 +++ b/rootfs/lib/libtaz.sh Thu Mar 22 04:32:12 2018 +0200 @@ -53,7 +53,7 @@ status() { local ret_code=$? [ -n "$quiet" -a "$ret_code" -eq 0 ] && return - [ -n "$quiet" ] && action "$saved_action" no-quiet + [ -n "$quiet" ] && quiet='once' action "$saved_action" case $ret_code in 0) local msg="$okmsg" color="$okcolor";; @@ -249,8 +249,8 @@ # Print current action saved_action='' action() { - saved_action="$1" - [ -n "$quiet" -a -z "$2" ] && return + saved_action="$(_n "$@")" + [ "$quiet" == 'yes' ] && return local w c scol msg chars # Translators: 'w' is the width the wider translated message ('[ Done ]' or '[ Failed ]') takes in a terminal; place here the number w=$(_ 'w'); w=${w/w/10} @@ -264,6 +264,7 @@ raw|gtk|html) echo -n "$msg";; *) echo -ne "\033[0;33m$msg\033[0m";; esac + quiet=${quiet/once/yes} } # Print long line as list item