From 80caa5ea2ef4696d79943673691c80b76e7a52bb Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Tue, 4 Nov 2014 02:44:05 -0500 Subject: [PATCH] debian: cleanup; everything working except whonix template update --- functions.sh | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/functions.sh b/functions.sh index 4296bd6..6ded53f 100755 --- a/functions.sh +++ b/functions.sh @@ -1,7 +1,6 @@ #!/bin/bash # vim: set ts=4 sw=4 sts=4 et : -# XXX set -e ################################################################################ @@ -77,22 +76,10 @@ fi # ------------------------------------------------------------------------------ # Only output text under certain conditions output() { - case ${VERBOSE} in - 0) - true "${1}" - ;; - 1) - echo -e "${1}" - ;; - 2) - # Don't echo if -x is set since it will already be displayed via true - [[ ${-/x} != $- ]] || echo -e "${1}" - true "${1}" - ;; - *) - true "${1}" - ;; - esac + if [ "${VERBOSE}" -ge 1 ]; then + # Don't echo if -x is set since it will already be displayed via true + [[ ${-/x} != $- ]] || echo -e "${1}" + fi } info() { @@ -252,7 +239,6 @@ templateDir() { for element in "${TEMPLATE_FLAVOR_DIR[@]}" do # (wheezy+whonix-gateway / wheezy+whonix-gateway+gnome[+++] / wheezy+gnome ) - #if [ "${element%:*}" == "$(templateFlavorPrefix ${template_flavor})${template_flavor}" ]; then if [ "${element%:*}" == "$(templateName ${template_flavor})" ]; then eval echo -e ${element#*:} return @@ -300,8 +286,8 @@ buildStepExec() { script="$(templateFile "${filename}" "${suffix}" "${template_flavor}")" - #if [ -f "${script}" ]; then if [ -f "${script}" ] && [ ! ${GLOBAL_CACHE[$script]+_} ]; then + # Test module expects raw output back only used to asser test results if [[ -n ${TEST} ]]; then echo "${script}" @@ -387,13 +373,6 @@ getFileLocations() { local suffix="$3" local function="templateFile" - - #IFS_orig="${IFS}}"; IFS=$'\n' - #files=( $(callTemplateFunction "${filename}" "${suffix}" "${function}") ) - #setArrayAsGlobal files $return_global_var - - # XXX - #files=$(callTemplateFunction "${filename}" "${suffix}" "${function}") files="$(callTemplateFunction "${filename}" "${suffix}" "${function}")" IFS_orig="${IFS}}"; IFS=$'\n'