From 14b1ad4f76716da4464e91211e65f45b8339e5b2 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 11 2013 15:08:09 +0000 Subject: Update centos-art.sh scripts. - Previously, when passing arguments to centos-art.sh command-line, it was possible to use dot (.) as argument to refer the current directory but it was not possible to make reference to directories from the current location on. This commit makes possible to make relative references to directories using the dot-slash (./) construction. - Previously, there was not a defined directory inside modules to directory structure to store module's auxiliary files (e.g., sed scripts, awk scripts, etc.). This commit sets the Configs/ directory for such purposes. To reference the Configs/ directory, when writing modules, you need to use the MODULE_DIR_CONFIGS variable and set TCAR_SCRIPT_MODULES_BASEDIR=${MODULE_DIR_MODULES} inside ${MODULE_NAME}.conf.sh file. - Previously, there was non a way to reference the copyright's first year but writing it literally. This commit adds the =COPYRIGHT_YEAR_FIRST= translation marker for it. --- diff --git a/Automation/Scripts/tcar_checkRepoDirSource.sh b/Automation/Scripts/tcar_checkRepoDirSource.sh index 4277520..0b70b4b 100755 --- a/Automation/Scripts/tcar_checkRepoDirSource.sh +++ b/Automation/Scripts/tcar_checkRepoDirSource.sh @@ -50,8 +50,9 @@ function tcar_checkRepoDirSource { # argument to centos-art command-line, the current location is # used as default location). However, it might be useful to use a # dot as argument when you want to include the current location in - # a list of arguments to process. - LOCATION=$(echo "${LOCATION}" | sed -r "s,^\.$,$(pwd),g") + # a list of arguments to process. Don't forget that dot slash can + # be used to refere locations relatively. + LOCATION=$(echo "${LOCATION}" | sed -r "s,^\.(/[[:alnum:]_/-.]+)?$,$(pwd)\1,g") # Remove the working directory absolute path from location to # avoid path duplications here. diff --git a/Automation/Scripts/tcar_setModuleEnvironment.sh b/Automation/Scripts/tcar_setModuleEnvironment.sh index 4e65935..84cfc26 100755 --- a/Automation/Scripts/tcar_setModuleEnvironment.sh +++ b/Automation/Scripts/tcar_setModuleEnvironment.sh @@ -46,6 +46,7 @@ function tcar_setModuleEnvironment { # Define module's related directories. local MODULE_DIR_MODULES=${MODULE_DIR}/Modules local MODULE_DIR_MANUALS=${MODULE_DIR}/Manuals + local MODULE_DIR_CONFIGS=${MODULE_DIR}/Configs # Define module's initialization file. local MODULE_INIT_FILE=${MODULE_DIR}/${MODULE_NAME}.sh diff --git a/Automation/Scripts/tcar_setTranslationMarkers.sh b/Automation/Scripts/tcar_setTranslationMarkers.sh index d42cbe9..2718154 100755 --- a/Automation/Scripts/tcar_setTranslationMarkers.sh +++ b/Automation/Scripts/tcar_setTranslationMarkers.sh @@ -44,6 +44,8 @@ function tcar_setTranslationMarkers { tcar_checkFiles -ef ${LOCATION} # Define copyright translation markers. + SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR_FIRST=' + DST[((++${#DST[*]}))]="$(tcar_printCopyrightInfo --first-year)" SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(_LAST)?=' DST[((++${#DST[*]}))]="$(tcar_printCopyrightInfo --year)" SRC[((++${#SRC[*]}))]='=COPYRIGHT_YEAR(S)?_LIST='