From 9866fc0d76b88c9d86cb003c1b7db05430985770 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Dec 26 2013 22:50:11 +0000 Subject: Update variable definition inside tcar.sh. - Previously, TCAR_BASEDIR was pointing to automation scripts directory. This is incorrect because TCAR_BASEDIR must point to the root directory where The CentOS Artwork Repository was installed in (e.g., /usr/share/tcar). This update changes TCAR_BASEDIR value to hold the correct value and adds the TCAR_SCRIPT_BASEDIR variable to hold the root location of automation scripts. - Previously, the =TCAR_WORKDIR= translation marker expanded to TCAR_BASEDIR. This is incorrect because TCAR_WORKDIR and TCAR_BASEDIR have not the same value. This update prevents =TCAR_WORKDIR= from expanding to TCAR_BASEDIR value. --- diff --git a/tcar-scripts/tcar.sh b/tcar-scripts/tcar.sh index 6f6b681..4737b18 100755 --- a/tcar-scripts/tcar.sh +++ b/tcar-scripts/tcar.sh @@ -36,12 +36,16 @@ declare -xr TCAR_SCRIPT_VERSION="$(rpm -q --qf "%{VERSION}" ${TCAR_SCRIPT_PACKAG ###################################################################### # Base directory where repository files are installed in. -declare -xr TCAR_BASEDIR=/usr/share/tcar/Scripts +declare -xr TCAR_BASEDIR=/usr/share/tcar -# Base directory where final content is produced. This value should be -# customized later by the user. +# Base directory where final content is produced in. This value is +# also known as the "workplace" and should be customized later by the +# user, using the prepare module of tcar script. declare -xr TCAR_WORKDIR=/tmp +# Base directory where automation scripts are installed in. +declare -xr TCAR_SCRIPT_BASEDIR=${TCAR_BASEDIR}/Scripts + # Directory to store temporal files. declare -xr TCAR_SCRIPT_TEMPDIR=$(mktemp -p /tmp -d ${TCAR_SCRIPT_PACKAGE}-XXXXXX) @@ -54,7 +58,7 @@ declare -xr TCAR_SCRIPT_CONFIG=${HOME}/.tcar.conf declare -xr TCAR_SCRIPT_MANUALS=/usr/share/man # Base directory where automation script modules are installed in. -declare -xr TCAR_SCRIPT_MODULES_BASEDIR=${TCAR_BASEDIR}/Modules +declare -xr TCAR_SCRIPT_MODULES_BASEDIR=${TCAR_SCRIPT_BASEDIR}/Modules # Default text editor. declare -x TCAR_SCRIPT_EDITOR=/usr/bin/vim @@ -88,7 +92,7 @@ declare -x TEXTDOMAIN="${TCAR_SCRIPT_PACKAGE}" # gettext system to know where the machine objects are stored in. This # variable is reset each time a new module is loaded, so the correct # files can be used. -declare -x TEXTDOMAINDIR=/usr/share/locale +declare -xr TEXTDOMAINDIR=/usr/share/locale ###################################################################### # Global Flags @@ -122,7 +126,7 @@ declare -x TCAR_FLAG_DEBUG='false' ###################################################################### # Export script's environment functions. -for SCRIPT_FILE in $(ls ${TCAR_BASEDIR}/tcar_*.sh);do +for SCRIPT_FILE in $(ls ${TCAR_SCRIPT_BASEDIR}/tcar_*.sh);do if [[ -x ${SCRIPT_FILE} ]];then . ${SCRIPT_FILE} export -f $(grep '^function ' ${SCRIPT_FILE} | cut -d' ' -f2) diff --git a/tcar-scripts/tcar_setTranslationMarkers.sh b/tcar-scripts/tcar_setTranslationMarkers.sh index 1ec018e..43d61bc 100755 --- a/tcar-scripts/tcar_setTranslationMarkers.sh +++ b/tcar-scripts/tcar_setTranslationMarkers.sh @@ -120,7 +120,7 @@ function tcar_setTranslationMarkers { fi # Define repository translation markers. - SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_BASEDIR|TCAR_WORKDIR)=' + SRC[((++${#SRC[*]}))]='=(REPO_TLDIR|REPO_HOME|TCAR_BASEDIR)=' DST[((++${#DST[*]}))]="${TCAR_BASEDIR}" # Do replacement of nested translation markers.