From 63338f7d32b0982200b4eeb5465d57c149c7a586 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 10 2013 00:39:00 +0000 Subject: Update tcar_setModuleEnvironment.sh file. - Previously, debugging information related to execution and destruction of module environment was using the count information after and before the counter variable itself was incremented and decremented. This made debugging information to print a value for module's counter different from which it was to set the module initialization file. This update changes the tcar_setModuleEnvironment function to move the debugging information related to execution and destruction of module environments before and after the count variable increasing and decreasing stanza to print the correct count value for the current module's initialization script. --- diff --git a/Automation/Scripts/tcar_setModuleEnvironment.sh b/Automation/Scripts/tcar_setModuleEnvironment.sh index 4646f05..c8cbb0b 100755 --- a/Automation/Scripts/tcar_setModuleEnvironment.sh +++ b/Automation/Scripts/tcar_setModuleEnvironment.sh @@ -72,7 +72,7 @@ function tcar_setModuleEnvironment { # Define module's name. TCAR_MODULE_NAMES[${TCAR_MODULE_COUNT}]=$(tcar_getRepoName "${ARG_MODULE_NAME:-unknown}" "-f" | cut -d '-' -f1) local TCAR_MODULE_NAME=${TCAR_MODULE_NAMES[${TCAR_MODULE_COUNT}]} - tcar_printMessage "TCAR_MODULE_NAME : [${TCAR_MODULE_COUNT}]=${TCAR_MODULE_NAME} | ${#TCAR_MODULE_NAMES[*]}" --as-debugger-line + tcar_printMessage "TCAR_MODULE_NAME : [${TCAR_MODULE_COUNT}]=${TCAR_MODULE_NAME}" --as-debugger-line # Define module's type. TCAR_MODULE_TYPES[${TCAR_MODULE_COUNT}]="${ARG_MODULE_TYPE:-parent}" @@ -124,10 +124,11 @@ function tcar_setModuleEnvironment { local TEXTDOMAINDIR=${TCAR_MODULE_DIR_LOCALES} tcar_printMessage "TEXTDOMAINDIR: ${TEXTDOMAINDIR}" --as-debugger-line + tcar_printMessage "=========================>: [${TCAR_MODULE_COUNT}]=${TCAR_MODULE_NAME} ${TCAR_MODULE_ARGUMENT}" --as-debugger-line + # Increment module's counter just before creating next module's # base directory. TCAR_MODULE_COUNT=$(( ${TCAR_MODULE_COUNT} + 1 )) - tcar_printMessage "TCAR_MODULE_COUNT: ${TCAR_MODULE_COUNT}" --as-debugger-line # Define next module's base directory. TCAR_MODULE_BASEDIRS[${TCAR_MODULE_COUNT}]=${TCAR_MODULE_DIR_MODULES} @@ -140,18 +141,17 @@ function tcar_setModuleEnvironment { # call after all variables and arguments definitions. tcar_setModuleEnvironmentScripts - # Execute module's initialization script. - tcar_printMessage "=========================>: ${TCAR_MODULE_NAME} ${TCAR_MODULE_ARGUMENT}" --as-debugger-line + # Execute module's initialization script with its arguments. ${TCAR_MODULE_NAME} ${TCAR_MODULE_ARGUMENT} # Unset module-specific environment. - tcar_printMessage "<=========================: ${TCAR_MODULE_NAME}" --as-debugger-line tcar_unsetModuleEnvironment # Decrement module counter just after unset unused module # environments. TCAR_MODULE_COUNT=$(( ${TCAR_MODULE_COUNT} - 1 )) - tcar_printMessage "TCAR_MODULE_COUNT: ${TCAR_MODULE_COUNT}" --as-debugger-line + + tcar_printMessage "<=========================: [${TCAR_MODULE_COUNT}]=${TCAR_MODULE_NAME} ${TCAR_MODULE_ARGUMENT}" --as-debugger-line # Unset array and non-array variables used in this function. if [[ ${TCAR_MODULE_COUNT} -eq 0 ]];then