From 163b4ddc0988559828e760868003475251416683 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 07 2013 07:15:15 +0000 Subject: Update locale module of centos-art.sh script. - Previously, definition of PACKAGE_NAME and PACKAGE_VERSION variables were set inside sh function. This update moves definition of these variables from sh function to directory_getConfiguration function which is higher in the module chain. Putting definition of these variables at directory_getConfiguration function serves also to other functions at the same level of sh, like svg and asciidoc that need them too. With this update we avoid to duplicate definition of PACKAGE_NAME and PACKAGE_VERSION variables in function files like, sh, svg, and asciidoc when directory processing is performed. --- diff --git a/Automation/Modules/Locale/Modules/Actions/Modules/Update/Modules/Sh/sh.sh b/Automation/Modules/Locale/Modules/Actions/Modules/Update/Modules/Sh/sh.sh index a7d3477..1015d59 100755 --- a/Automation/Modules/Locale/Modules/Actions/Modules/Update/Modules/Sh/sh.sh +++ b/Automation/Modules/Locale/Modules/Actions/Modules/Update/Modules/Sh/sh.sh @@ -30,16 +30,6 @@ function sh { # Print action message. tcar_printMessage "${POT_FILE}" --as-updating-line - # Define package name. This is the name of the initialization file - # you provided as argument to the command line to provide - # localization for. - local PACKAGE_NAME=${FILE_NAME} - - # Define package version. The script version is used here. Modules - # doesn't have a version by now. They share the same version of - # the centos-art.sh script. - local PACKAGE_VERSION=${TCAR_SCRIPT_VERSION} - # Retrieve translatable strings from shell script files and create # the portable object template (.pot) from them. xgettext --output=${POT_FILE} --width=70 \ diff --git a/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh b/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh index 63cfc44..e1e719e 100755 --- a/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh +++ b/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh @@ -91,6 +91,16 @@ function directory_getConfiguration { local PO_FILE=${TRANSLATIONS[0]} + # Define package name. This is the name of the initialization + # file you provided as argument to the command line to provide + # localization for. + local PACKAGE_NAME=$(basename ${RENDER_FROM}) + + # Define package version. The script version is used here. + # Modules doesn't have a version by now. They share the same + # version of the centos-art.sh script. + local PACKAGE_VERSION=${TCAR_SCRIPT_VERSION} + # Initialize locale's actions module. tcar_setModuleEnvironment -m "actions" -t "sib-module"