Project

General

Profile

« Previous | Next » 

Revision 9878

bugfix: lib/sh/util.sh: verbosity_compat(): always use default verbosity (`unset verbosity`) when verbosity == 1, regardless of whether the caller has set $verbosity to the special value "", because $verbosity is supposed to be an integer field and "" is not supported by most functions that use $verbosity. in cases where a util.sh script is invoked, it will set $verbosity back to the default value 1, so this will function as before for util.sh scripts and fix $verbosity for scripts that use a different verbosity system.

View differences:

lib/sh/util.sh
332 332
{ if test ! "$1" -o "$(verbosity_int)" -lt "$1"; then verbosity="$1"; fi; }
333 333
alias verbosity_min='log_local; "verbosity_min"'
334 334

  
335
# usage: (verbosity_compat; cmd) # cmd doesn't support verbosity=''
335
# usage: (verbosity_compat; cmd)
336 336
function verbosity_compat()
337
{ echo_func; if test "$verbosity" = ''; then unset verbosity; fi; }
337
{ echo_func; if ((verbosity == 1)); then unset verbosity; fi; }
338 338
alias verbosity_compat='declare verbosity; "verbosity_compat"'
339 339

  
340 340

  

Also available in: Unified diff