confz

git mirror of https://ccx.te2000.cz/bzr/confz
git clone https://ccx.te2000.cz/git/confz
Log | Files | Refs

commit 808693ad80ed9f44569172517383f658e8cb603f
parent 0f634210ecbebedf909b9082ac286600cd5c2bb6
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Thu, 19 Jun 2014 20:38:30 +0200

check return handling, auto-xtrace when $verbose
Diffstat:
Mbin/confz | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/bin/confz b/bin/confz @@ -96,7 +96,7 @@ require() { # to variable ${vars[bar]} of caller # <arguments> are arguments passed to the dependency function - local name outer inner indent_prev check_only_prev + local name outer inner indent_prev check_only_prev check_ret local -a do_command_prev local -A vars_local lift @@ -132,10 +132,18 @@ require() { if confz_${name}_check "$@"; then confz_check_ok $name else + check_ret=$? + confz_check_fail $name + if (($check_only)); then - die "$name: check failed with error $?" + if (($verbose)); then + print "re-running check with xtrace" + set +x + confz_${name}_check + set -x + fi + die "$name: check failed with error $check_ret" else - confz_check_fail $name confz_do "${do_command[@]}" "$@" # print check start