From 7b46a4851da61c6e0466d3c8a10b34b4bf6a0c28 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 24 2011 20:22:50 +0000 Subject: Start using HOME, CLI_PROGRAM, CLI_VERSION, CLI_BASEDIR instead of static information. --- diff --git a/Scripts/Bash/centos-art/Functions/Html/html_updateHeadings.sh b/Scripts/Bash/centos-art/Functions/Html/html_updateHeadings.sh index 9b1dc3a..8f47bff 100644 --- a/Scripts/Bash/centos-art/Functions/Html/html_updateHeadings.sh +++ b/Scripts/Bash/centos-art/Functions/Html/html_updateHeadings.sh @@ -144,7 +144,7 @@ function html_updateHeadings { for TOCENTRY in "${TOCENTRIES[@]}";do echo $TOCENTRY done \ - | awk -f /home/centos/artwork/trunk/Scripts/Bash/Functions/Html/Config/output_forHeadingsToc.awk) + | awk -f ${CLI_BASEDIR}/Functions/Html/Config/output_forHeadingsToc.awk) # Update table of contents inside the current file being # processed. diff --git a/Scripts/Bash/centos-art/Functions/Identity/identity_render.sh b/Scripts/Bash/centos-art/Functions/Identity/identity_render.sh index f5eb19f..288713e 100755 --- a/Scripts/Bash/centos-art/Functions/Identity/identity_render.sh +++ b/Scripts/Bash/centos-art/Functions/Identity/identity_render.sh @@ -24,7 +24,7 @@ # USA. # # ---------------------------------------------------------------------- -# $Id: identity_render.sh 824 2011-01-06 20:54:52Z al $ +# $Id$ # ---------------------------------------------------------------------- function identity_render { diff --git a/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageMetadata.sh b/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageMetadata.sh index 5f9bd04..edf3c85 100755 --- a/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageMetadata.sh +++ b/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageMetadata.sh @@ -52,7 +52,7 @@ function locale_updateMessageMetadata { SRC[3]='Language-Team:' # Define replacement lines for pattern line. - DST[0]="\"Project-Id-Version: ${CLINAME} (${CURRENTLOCALE})\\\n\"" + DST[0]="\"Project-Id-Version: ${CLI_PROGRAM} (${CURRENTLOCALE})\\\n\"" DST[1]="\"Report-Msgid-Bugs-To: =MAIL_DOCS=\\\n\"" DST[2]="\"Last-Translator: CentOS Documentation SIG\\\n\"" DST[3]="\"Language-Team: ${LANGNAME}\\\n\"" diff --git a/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageShell.sh b/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageShell.sh index 055475e..e805b26 100755 --- a/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageShell.sh +++ b/Scripts/Bash/centos-art/Functions/Locale/locale_updateMessageShell.sh @@ -43,7 +43,7 @@ function locale_updateMessageShell { fi # Build list of files to process. - if [[ $ACTIONVAL =~ "^$(cli_getRepoTLDir)/Scripts/Bash" ]];then + if [[ $ACTIONVAL =~ "^${CLI_BASEDIR}" ]];then FILES=$(cli_getFilesList "$ACTIONVAL" "${FLAG_FILTER}\.sh") else cli_printMessage "`gettext "The path provided can't be processed."`" 'AsErrorLine' diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_getNode.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_getNode.sh index 487ece5..a2d9b52 100755 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_getNode.sh +++ b/Scripts/Bash/centos-art/Functions/Manual/manual_getNode.sh @@ -27,7 +27,7 @@ function manual_getNode { local NODE=$(echo "$ACTIONVAL" \ - | sed -r 's!^/home/centos/artwork/!!' \ + | sed -r "s!^${HOME}/artwork/!!" \ | sed -r 's!/! !g' | sed -r 's!^[[:space:]]+!!') echo "$NODE" diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFileHtml.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFileHtml.sh index 326ac00..c44d708 100755 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFileHtml.sh +++ b/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFileHtml.sh @@ -41,8 +41,8 @@ function manual_updateOutputFileHtml { # format to html using CentOS Web default visual style. texi2html ${MANUAL_BASEFILE}.texi --output=${MANUAL_BASEFILE}-html --split section \ --nosec-nav \ - --css-include=/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/stylesheet.css \ - -I=/home/centos/artwork + --css-include=${HOME}/artwork/trunk/Identity/Models/Css/Texi2html/stylesheet.css \ + -I=${HOME}/artwork # Apply html transformations. Html transformations rely on # Texi2html default html output. The main goal of these html @@ -50,7 +50,7 @@ function manual_updateOutputFileHtml { # specific css definitions. This way we extend the visual style of # Texi2html default html output. sed -r -i \ - -f /home/centos/artwork/trunk/Identity/Models/Css/Texi2html/transformations.sed \ + -f ${HOME}/artwork/trunk/Identity/Models/Css/Texi2html/transformations.sed \ ${MANUAL_BASEFILE}-html/*.html # Remove html output directory from directory stack. diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFiles.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFiles.sh index 9535ccb..73ecd5e 100755 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFiles.sh +++ b/Scripts/Bash/centos-art/Functions/Manual/manual_updateOutputFiles.sh @@ -35,7 +35,7 @@ function manual_updateOutputFiles { # Add the working copy root directory to directory stack to make # path construction correctly. Otherwise, makeinfo may produce # paths incorrectly. - pushd /home/centos/artwork > /dev/null + pushd ${HOME}/artwork > /dev/null manual_updateOutputFileInfo manual_updateOutputFileHtml diff --git a/Scripts/Bash/centos-art/Functions/Shell/shell_updateCopyright.sh b/Scripts/Bash/centos-art/Functions/Shell/shell_updateCopyright.sh index 050383f..2d77ac4 100755 --- a/Scripts/Bash/centos-art/Functions/Shell/shell_updateCopyright.sh +++ b/Scripts/Bash/centos-art/Functions/Shell/shell_updateCopyright.sh @@ -41,7 +41,7 @@ function shell_updateCopyright { local -a MARKER # Define absolute path to template file. - TEMPLATE="/home/centos/artwork/trunk/Scripts/Bash/Functions/Shell/Config/tpl_forCopyright.sed" + TEMPLATE="${CLI_BASEDIR}/Functions/Shell/Config/tpl_forCopyright.sed" # Check template file existence. cli_checkFiles $TEMPLATE 'f' diff --git a/Scripts/Bash/centos-art/Functions/Svg/svg_updateMetadata.sh b/Scripts/Bash/centos-art/Functions/Svg/svg_updateMetadata.sh index ab39f03..2dcea67 100755 --- a/Scripts/Bash/centos-art/Functions/Svg/svg_updateMetadata.sh +++ b/Scripts/Bash/centos-art/Functions/Svg/svg_updateMetadata.sh @@ -45,7 +45,7 @@ function svg_updateMetadata { local -a DEFAULT # Define template file name. - TEMPLATE="/home/centos/artwork/trunk/Scripts/Bash/Functions/Svg/Config/tpl_forMetadata.sed" + TEMPLATE="${CLI_BASEDIR}/Functions/Svg/Config/tpl_forMetadata.sed" # Check template file existence. cli_checkFiles $TEMPLATE 'f' diff --git a/Scripts/Bash/centos-art/Functions/Verify/verify_doLinks.sh b/Scripts/Bash/centos-art/Functions/Verify/verify_doLinks.sh index 646377c..dcc5dd3 100755 --- a/Scripts/Bash/centos-art/Functions/Verify/verify_doLinks.sh +++ b/Scripts/Bash/centos-art/Functions/Verify/verify_doLinks.sh @@ -35,20 +35,20 @@ function verify_doLinks { local LINKS_MISSING_ID='' # Define link names. - LINKS[0]=/home/centos/bin/centos-art - LINKS[1]=/home/centos/.fonts/denmark.ttf - LINKS[2]=/home/centos/.inkscape/palettes/CentOS.gpl - LINKS[3]=/home/centos/.$(rpm -q gimp | cut -d. -f-2)/palettes/CentOS.gpl - LINKS[4]=/home/centos/artwork/branches/Scripts + LINKS[0]=${HOME}/bin/centos-art + LINKS[1]=${HOME}/.fonts/denmark.ttf + LINKS[2]=${HOME}/.inkscape/palettes/CentOS.gpl + LINKS[3]=${HOME}/.$(rpm -q gimp | cut -d. -f-2)/palettes/CentOS.gpl + LINKS[4]=${HOME}/artwork/branches/Scripts # Define link targets. Use array index as reference to know # relation between link names and targets. Be sure both link names # and link targets use the same array index value. - TARGETS[0]=/home/centos/artwork/trunk/Scripts/Bash/centos-art.sh - TARGETS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf/denmark.ttf - TARGETS[2]=/home/centos/artwork/trunk/Identity/Colors/CentOS.gpl + TARGETS[0]=${CLI_BASEDIR}/init.sh + TARGETS[1]=$(cli_getRepoTLDir)/Identity/Fonts/Ttf/denmark.ttf + TARGETS[2]=$(cli_getRepoTLDir)/Identity/Colors/CentOS.gpl TARGETS[3]=${TARGETS[2]} - TARGETS[4]=/home/centos/artwork/trunk/Scripts/ + TARGETS[4]=$(cli_getRepoTLDir)/Scripts/ verify_doLinkCheck verify_doLinkReport diff --git a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToCli.sh b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToCli.sh index ad35b8e..7a652f4 100755 --- a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToCli.sh +++ b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToCli.sh @@ -35,11 +35,11 @@ function verify_pathToCli { # line interface. REPODIRS[0]=/home/centos REPODIRS[1]=/home/centos/bin - REPODIRS[2]=/home/centos/artwork/trunk/Scripts/Bash + REPODIRS[2]=${CLI_BASEDIR} # Define files required by the centos-art.sh script command line # interface. - REPOFILES[0]=${REPODIRS[2]}/centos-art.sh + REPOFILES[0]=${REPODIRS[2]}/init.sh # Define symbolic links required by the centos-art.sh script # command line interface. diff --git a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToFonts.sh b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToFonts.sh index 90c1a23..eb40ab3 100644 --- a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToFonts.sh +++ b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToFonts.sh @@ -36,8 +36,8 @@ function verify_pathToFonts { local FILE='' # Define font related directories. - REPODIRS[0]=/home/centos/.fonts - REPODIRS[1]=/home/centos/artwork/trunk/Identity/Fonts/Ttf + REPODIRS[0]=${HOME}/.fonts + REPODIRS[1]=$(cli_getRepoTLDir)/Identity/Fonts/Ttf # Define font related files. REPOFILES[0]=${REPODIRS[1]}/denmark.ttf diff --git a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToInkscape.sh b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToInkscape.sh index 69d5932..fa1c57e 100755 --- a/Scripts/Bash/centos-art/Functions/Verify/verify_pathToInkscape.sh +++ b/Scripts/Bash/centos-art/Functions/Verify/verify_pathToInkscape.sh @@ -35,8 +35,8 @@ function verify_pathToInkscape { # Define directories required by the centos-art.sh script command # line interface. - REPODIRS[0]=/home/centos/.inkscape/palettes - REPODIRS[1]=/home/centos/artwork/trunk/Identity/Colors + REPODIRS[0]=${HOME}/.inkscape/palettes + REPODIRS[1]=$(cli_getRepoTLDir)/Identity/Colors # Define files required by the centos-art.sh script command line # interface. diff --git a/Scripts/Bash/centos-art/Functions/cli.sh b/Scripts/Bash/centos-art/Functions/cli.sh index e4b1e4b..0d36085 100644 --- a/Scripts/Bash/centos-art/Functions/cli.sh +++ b/Scripts/Bash/centos-art/Functions/cli.sh @@ -66,7 +66,7 @@ function cli { # Define function directory (FUNCDIR). The directory path where # functionalities are stored inside the repository. - FUNCDIR=/home/centos/artwork/trunk/Scripts/Bash/Functions + FUNCDIR=${CLI_BASEDIR}/Functions # Define function name (FUNCNAM) variable from first command-line # argument. As convenction we use the first argument to determine diff --git a/Scripts/Bash/centos-art/Functions/cli_checkPathComponent.sh b/Scripts/Bash/centos-art/Functions/cli_checkPathComponent.sh index 1b7fb9d..9b768fb 100755 --- a/Scripts/Bash/centos-art/Functions/cli_checkPathComponent.sh +++ b/Scripts/Bash/centos-art/Functions/cli_checkPathComponent.sh @@ -27,7 +27,7 @@ # USA. # # ---------------------------------------------------------------------- -# $Id: cli_checkPathComponent.sh 958 2011-01-26 16:05:59Z al $ +# $Id$ # ---------------------------------------------------------------------- function cli_checkPathComponent { diff --git a/Scripts/Bash/centos-art/Functions/cli_checkRepoDirSource.sh b/Scripts/Bash/centos-art/Functions/cli_checkRepoDirSource.sh index cab663f..666dc17 100755 --- a/Scripts/Bash/centos-art/Functions/cli_checkRepoDirSource.sh +++ b/Scripts/Bash/centos-art/Functions/cli_checkRepoDirSource.sh @@ -40,7 +40,7 @@ function cli_checkRepoDirSource { # trunk/..., the /home/centos/artwork/ part is automatically added # here. if [[ $ACTIONVAL =~ '^(trunk|branches|tags)' ]];then - ACTIONVAL=/home/centos/artwork/$ACTIONVAL + ACTIONVAL=${HOME}/artwork/$ACTIONVAL fi # Re-define source value to build repository absolute path from @@ -56,7 +56,7 @@ function cli_checkRepoDirSource { pushd "$ACTIONVAL" > /dev/null # Check directory existence inside the repository. - if [[ $(pwd) =~ '^/home/centos/artwork' ]];then + if [[ $(pwd) =~ "^${HOME}/artwork" ]];then # Re-define source value using absolute path. ACTIONVAL=$(pwd) else @@ -73,7 +73,7 @@ function cli_checkRepoDirSource { pushd "$(dirname "$ACTIONVAL")" > /dev/null # Check directory existence inside the repository. - if [[ $(pwd) =~ '^/home/centos/artwork' ]];then + if [[ $(pwd) =~ "^${HOME}/artwork" ]];then # Re-define source value using absolute path. ACTIONVAL=$(pwd)/$(basename "$ACTIONVAL") else diff --git a/Scripts/Bash/centos-art/Functions/cli_checkRepoDirTarget.sh b/Scripts/Bash/centos-art/Functions/cli_checkRepoDirTarget.sh index 77452aa..7d92673 100755 --- a/Scripts/Bash/centos-art/Functions/cli_checkRepoDirTarget.sh +++ b/Scripts/Bash/centos-art/Functions/cli_checkRepoDirTarget.sh @@ -39,7 +39,7 @@ function cli_checkRepoDirTarget { # trunk/..., the /home/centos/artwork/ part is automatically added # here. if [[ $FLAG_TO =~ '^(trunk|branches|tags)/.+$' ]];then - FLAG_TO=/home/centos/artwork/$FLAG_TO + FLAG_TO=${HOME}/artwork/$FLAG_TO fi # Check target value. @@ -62,7 +62,7 @@ function cli_checkRepoDirTarget { pushd "$(dirname "$FLAG_TO")" > /dev/null # Check directory existence inside the repository. - if [[ $(pwd) =~ '^/home/centos/artwork' ]];then + if [[ $(pwd) =~ "^${HOME}/artwork" ]];then # Re-define target value using absolute path. FLAG_TO=$(pwd)/$(basename "$FLAG_TO") fi diff --git a/Scripts/Bash/centos-art/Functions/cli_commitRepoChanges.sh b/Scripts/Bash/centos-art/Functions/cli_commitRepoChanges.sh index 3e5366d..9591bd3 100755 --- a/Scripts/Bash/centos-art/Functions/cli_commitRepoChanges.sh +++ b/Scripts/Bash/centos-art/Functions/cli_commitRepoChanges.sh @@ -64,7 +64,7 @@ function cli_commitRepoChanges { # inside this function. Whatever action you perform over URL will # take place immediatly through direct commit. LOCATIONS=$(echo -e "$LOCATIONS" | sed -r "s! +!\n!g" \ - | egrep '^/home/centos/artwork/(trunk|branches|tags)/.+$') + | egrep "^${HOME}/artwork/(trunk|branches|tags)/.+$") # Outout separator line. cli_printMessage '-' 'AsSeparatorLine' diff --git a/Scripts/Bash/centos-art/Functions/cli_doParseArguments.sh b/Scripts/Bash/centos-art/Functions/cli_doParseArguments.sh index 1f9126e..3b8718d 100755 --- a/Scripts/Bash/centos-art/Functions/cli_doParseArguments.sh +++ b/Scripts/Bash/centos-art/Functions/cli_doParseArguments.sh @@ -51,7 +51,7 @@ function cli_doParseArguments { eval set -- "$ARGUMENTS" # Parse optional arguments using getopt. - ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n $CLINAME -- "$@") + ARGUMENTS=$(getopt -o "$ARGSS" -l "$ARGSL" -n $CLI_PROGRAM -- "$@") # Be sure getout parsed arguments successfully. if [[ $? != 0 ]]; then diff --git a/Scripts/Bash/centos-art/Functions/cli_getRepoTLDir.sh b/Scripts/Bash/centos-art/Functions/cli_getRepoTLDir.sh index ce6ed8f..233b651 100755 --- a/Scripts/Bash/centos-art/Functions/cli_getRepoTLDir.sh +++ b/Scripts/Bash/centos-art/Functions/cli_getRepoTLDir.sh @@ -42,14 +42,14 @@ function cli_getRepoTLDir { fi # Verify location. - if [[ $LOCATION =~ '^/home/centos/artwork/(trunk|branches|tags)/.+$' ]];then + if [[ $LOCATION =~ "^${HOME}/artwork/(trunk|branches|tags)/.+$" ]];then case "$2" in -r|--relative ) - PATTERN='^/home/centos/artwork/(trunk|branches|tags)/.+$' + PATTERN="^${HOME}/artwork/(trunk|branches|tags)/.+$" REPLACE='\1' ;; -a|--absolute|* ) - PATTERN='^(/home/centos/artwork/(trunk|branches|tags))/.+$' + PATTERN="^(${HOME}/artwork/(trunk|branches|tags))/.+$" REPLACE='\1' ;; esac diff --git a/Scripts/Bash/centos-art/Functions/cli_getTemporalFile.sh b/Scripts/Bash/centos-art/Functions/cli_getTemporalFile.sh index 51ff71a..2baceda 100755 --- a/Scripts/Bash/centos-art/Functions/cli_getTemporalFile.sh +++ b/Scripts/Bash/centos-art/Functions/cli_getTemporalFile.sh @@ -49,7 +49,7 @@ function cli_getTemporalFile { local TMPDIR='/tmp' # Define default prefix for temporal file. - local PREFIX='centos-art.sh-' + local PREFIX="${CLI_PROGRAM}-" # Define unique identifier for temporal file. local UUID=$(cat /proc/sys/kernel/random/uuid) diff --git a/Scripts/Bash/centos-art/Functions/cli_printMessage.sh b/Scripts/Bash/centos-art/Functions/cli_printMessage.sh index 05db63a..2637e4f 100755 --- a/Scripts/Bash/centos-art/Functions/cli_printMessage.sh +++ b/Scripts/Bash/centos-art/Functions/cli_printMessage.sh @@ -33,7 +33,7 @@ function cli_printMessage { # Reduce paths inside output messages. The main purpose for this # is to free horizontal space in output messages. MESSAGE=$(echo "$MESSAGE" \ - | sed -r 's!/home/centos/artwork/(trunk|branches|tags)/!\1/!g') + | sed -r "s!^${HOME}/artwork/(trunk|branches|tags)/!\1/!g") # Remove blank spaces from lines' begining. MESSAGE=$(echo "$MESSAGE" | sed -r 's!^[[:space:]]+!!') @@ -96,7 +96,7 @@ function cli_printMessage { 'AsErrorLine' ) # This option is used to print error messsages. - echo "${CLINAME}: ${MESSAGE}" > /dev/stderr + echo "${CLI_PROGRAM}: ${MESSAGE}" > /dev/stderr ;; 'AsToKnowMoreLine' ) @@ -168,7 +168,7 @@ function cli_printMessage { 'AsRegularLine' | * ) if [[ "$FLAG_QUIET" == 'false' ]];then echo "$MESSAGE" \ - | awk -f /home/centos/artwork/trunk/Scripts/Bash/Styles/output_forTwoColumns.awk \ + | awk -f ${CLI_BASEDIR}/Styles/output_forTwoColumns.awk \ > /dev/stderr fi ;; diff --git a/Scripts/Bash/centos-art/Styles/renameFile.sh b/Scripts/Bash/centos-art/Styles/renameFile.sh index 91d0dfe..372db1e 100755 --- a/Scripts/Bash/centos-art/Styles/renameFile.sh +++ b/Scripts/Bash/centos-art/Styles/renameFile.sh @@ -21,7 +21,7 @@ # USA. # # ---------------------------------------------------------------------- -# $Id: renameFile.sh 12 2010-09-10 09:55:08Z al $ +# $Id$ # ---------------------------------------------------------------------- diff --git a/Scripts/Bash/centos-art/init.sh b/Scripts/Bash/centos-art/init.sh index 22ce82f..b63eb6d 100755 --- a/Scripts/Bash/centos-art/init.sh +++ b/Scripts/Bash/centos-art/init.sh @@ -1,13 +1,7 @@ #!/bin/bash # -# centos-art.sh -- The CentOS Artwork Repository automation tool -# initialization script. -# -# This is the first script that centos-art command initiates. This -# script contains a serie of desition about which configuration script -# to load based. To determine which configuration script to load, the -# absolute path from which the command centos-art was initially called -# is used as reference. +# init.sh -- This file is the centos-art initialization script, the +# first script the centos-art command executes. # # Copyright (C) 2009-2011 Alain Reguera Delgado # @@ -27,27 +21,36 @@ # USA. # # ---------------------------------------------------------------------- -# $Id: centos-art.sh 70 2010-09-18 04:38:43Z al $ +# $Id$ # ---------------------------------------------------------------------- -# Initizalize centos-art.sh gettext internazionalization. +# Most paths are built from HOME variable on, so we need to make our +# best to make it contain a valid value before any path be built from +# it. Using HOME variable gives us some flexibility to store the +# repository filesystem in a location different from `/home/centos', +# the default home directory centos-art assumes if HOME variable is +# empty or malformed. +[[ ! $HOME =~ '^/home/[[:alnum:]]+' ]] && HOME='/home/centos' + +# Initizalize internazionalization through gettext. . gettext.sh export TEXTDOMAIN=centos-art.sh -export TEXTDOMAINDIR=/home/centos/artwork/trunk/Locales/Scripts/centos-art.sh/ +export TEXTDOMAINDIR=${HOME}/artwork/trunk/Locales/Scripts/Bash/centos-art -# Initialize centos-art.sh personal information. -export CLINAME='centos-art' -export CLIVERSION='1.0 (beta)' +# Initialize personal information. +export CLI_PROGRAM='centos-art' +export CLI_VERSION='1.0 (beta)' +export CLI_BASEDIR="${HOME}/artwork/trunk/Scripts/Bash/${CLI_PROGRAM}" -# Initialize centos-art.sh function scripts. -FILES=$(ls /home/centos/artwork/trunk/Scripts/Bash/Functions/{cli,cli_*}.sh) -for FILE in $FILES;do - if [[ -x $FILE ]];then - . $FILE - FUNCTION=$(grep '^function ' $FILE | cut -d' ' -f2) - export -f $FUNCTION +# Initialize common function scripts. +FILES=$(ls ${CLI_BASEDIR}/Functions/{cli,cli_*}.sh) +for FILE in ${FILES};do + if [[ -x ${FILE} ]];then + . ${FILE} + FUNCTION=$(grep '^function ' ${FILE} | cut -d' ' -f2) + export -f ${FUNCTION} else - echo `gettext "The $FILE needs to have execution rights."` + echo `gettext "The ${FILE} needs to have execution rights."` > /dev/stderr exit fi done @@ -58,5 +61,5 @@ unset FILE unset FILES unset FUNCTION -# Initialize command line interface. +# Initialize command-line interface. cli "$@"