From 2ae54a5163e52abf9a940d2de4c4762e138a34c6 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jul 17 2013 22:36:15 +0000 Subject: Update variable names inside centos-art.sh script. --- diff --git a/Automation/Scripts/tcar_printHelp.sh b/Automation/Scripts/tcar_printHelp.sh index ae96175..17c8750 100755 --- a/Automation/Scripts/tcar_printHelp.sh +++ b/Automation/Scripts/tcar_printHelp.sh @@ -28,7 +28,7 @@ function tcar_printHelp { - ${TCAR_MANUAL_READER} "${MODULE_NAME}" + /usr/bin/man -M ${MODULE_DIR_MANUALS} "${MODULE_NAME}" exit 0 } diff --git a/Automation/Scripts/tcar_setModuleEnvironment.sh b/Automation/Scripts/tcar_setModuleEnvironment.sh index bfb8f9c..47c5837 100755 --- a/Automation/Scripts/tcar_setModuleEnvironment.sh +++ b/Automation/Scripts/tcar_setModuleEnvironment.sh @@ -41,10 +41,16 @@ function tcar_setModuleEnvironment { tcar_printMessage "`gettext "The module provided isn't valid."`" --as-error-line fi - # Define function directory. + # Define module's directory. local MODULE_DIR=${TCAR_SCRIPT_MODULES_BASEDIR}/$(tcar_getRepoName "${MODULE_NAME}" "-d") - # Define function file name. + # Define module's related directories. + local MODULE_DIR_MODULES=${MODULE_DIR}/Modules + local MODULE_DIR_MANUALS=${MODULE_DIR}/Manuals + local MODULE_DIR_SCRIPTS=${MODULE_DIR}/Scripts + local MODULE_DIR_LOCALES=${MODULE_DIR}/Locales + + # Define module's initialization file. local MODULE_INIT_FILE=${MODULE_DIR}/${MODULE_NAME}.sh # Check function script execution rights. @@ -52,7 +58,7 @@ function tcar_setModuleEnvironment { # Remove the first argument passed to centos-art.sh command-line # in order to build optional arguments inside functionalities. We - # start counting from second argument (inclusive) on. + # start counting from second argument on, inclusively. shift 1 # Verify number of arguments passed to centos-art.sh script. By @@ -71,17 +77,12 @@ function tcar_setModuleEnvironment { declare -x TEXTDOMAIN=${MODULE_NAME} declare -x TEXTDOMAINDIR=${MODULE_DIR}/Locales - # Redefine module-specific manuals configuration values. - declare -x TCAR_MANUAL_FILE=${MODULE_DIR}/${MODULE_NAME}.asciidoc - declare -x TCAR_MANUAL_SEARCHPATH=${MODULE_DIR}/Manuals - declare -x TCAR_MANUAL_READER="/usr/bin/man -M ${TCAR_MANUAL_SEARCHPATH}" - - # Go for function initialization. Keep the - # tcar_setModuleEnvironmentScripts function calling after all - # variables and arguments definitions. - tcar_setModuleEnvironmentScripts "${MODULE_INIT_FILE}" + # Load module-specific (function) scripts into current execution + # environment. Keep the tcar_setModuleEnvironmentScripts function + # call after all variables and arguments definitions. + tcar_setModuleEnvironmentScripts - # Execute function. + # Execute module-specific initialization script. ${MODULE_NAME} "${@}" } diff --git a/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh b/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh index 39c5231..03997bc 100755 --- a/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh +++ b/Automation/Scripts/tcar_setModuleEnvironmentScripts.sh @@ -29,25 +29,13 @@ function tcar_setModuleEnvironmentScripts { - # Retrieve export identifier for the function we want to export. - local MODULE_INIT_FILE="${1}" - - # Verify the export identification existence. - tcar_checkFiles -x ${MODULE_INIT_FILE} - - # Define the source location where function files are placed in. - local MODULE_SCRIPTS_DIR=$(dirname ${MODULE_INIT_FILE})/Scripts - - # Define suffix used to retrieve function files. - local MODULE_INIT_FILENAME=$(basename "${MODULE_INIT_FILE}" | sed -r 's/\.sh$//') - # Define the pattern used to retrieve function names from function # files. - local FUNCTION_PATTERN="^function[[:space:]]+${MODULE_INIT_FILENAME}(_[[:alnum:]]+)?[[:space:]]+{[[:space:]]*$" + local FUNCTION_PATTERN="^function[[:space:]]+${MODULE_NAME}(_[[:alnum:]]+)?[[:space:]]+{[[:space:]]*$" # Define the list of files. local MODULE_SCRIPTS="${MODULE_INIT_FILE} - $(tcar_getFilesList ${MODULE_SCRIPTS_DIR} \ + $(tcar_getFilesList ${MODULE_DIR_SCRIPTS} \ --pattern="${MODULE_DIR}/.+\.sh$" --maxdepth='1' \ --mindepth='1' --type='f')"