From 87ccb81fc08b9cb89cbfa1a33b4108552d6b9673 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 07 2013 07:29:39 +0000 Subject: Update locale module of centos-art.sh script. - Previously, PACKAGE_NAME inside directory_getConfiguration was set to RENDER_FROM basename. To prevent confusions, this update changes the directory_getConfiguration function to use ${SOURCES[0]} instead. This is the first possible value passed to RENDER_FROM. - Previously, PACKAGE_NAME and PACKAGE_VERSION were available only when processing directories. This update changes the file function to add both PACKAGE_NAME and PACKAGE_VERSION to it. So, the information they provide is now available when processing files, too. --- diff --git a/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh b/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh index e1e719e..4a8baa3 100755 --- a/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh +++ b/Automation/Modules/Locale/Modules/Directory/directory_getConfiguration.sh @@ -91,14 +91,15 @@ 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. + # Define package name written in POT and PO files. This is the + # name of the initialization file you provided as argument to + # the command line to provide localization for. + local PACKAGE_NAME=$(basename ${SOURCES[0]}) + + # Define package version written in POT and PO files. 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. diff --git a/Automation/Modules/Locale/Modules/File/file.sh b/Automation/Modules/Locale/Modules/File/file.sh index f1d5eed..ccbb9cc 100755 --- a/Automation/Modules/Locale/Modules/File/file.sh +++ b/Automation/Modules/Locale/Modules/File/file.sh @@ -72,6 +72,16 @@ function file { SOURCES[((++${#SOURCES[*]}))]=${SOURCE} done + # Define package name written in POT and PO files. This is the + # name of the initialization file you provided as argument to the + # command line to provide localization for. + local PACKAGE_NAME=$(basename ${FILE_NAME}) + + # Define package version written in POT and PO files. 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} + # Process configuration variables through locale's actions module. tcar_setModuleEnvironment -m "actions" -t "sib-module"