| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_checkRepoDirSource { |
| |
| |
| if [[ $ACTIONVAL == '' ]] \ |
| || [[ $ACTIONVAL =~ '(\.\.(/)?)' ]] \ |
| || [[ ! $ACTIONVAL =~ '^[A-Za-z0-9\.:/-]+$' ]];then |
| cli_printMessage "`eval_gettext "The value \\\`\\\$ACTIONVAL' is not valid."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" "AsToKnowMoreLine" |
| fi |
| |
| # Redefine source value to build repository absolute path from |
| # repository top level on. As we are removing |
| # /home/centos/artwork/ from all centos-art.sh output (in order to |
| # save horizontal output space), we need to be sure that all |
| # strings begining with trunk/..., branches/..., and tags/... use |
| # the correct absolute path. That is, you can refer trunk's |
| |
| |
| |
| if [[ $ACTIONVAL =~ '^(trunk|branches|tags)' ]];then |
| ACTIONVAL=/home/centos/artwork/$ACTIONVAL |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ -d ${ACTIONVAL} ]];then |
| |
| |
| pushd "$ACTIONVAL" > /dev/null |
| |
| |
| if [[ $(pwd) =~ '^/home/centos/artwork' ]];then |
| |
| ACTIONVAL=$(pwd) |
| else |
| cli_printMessage "`eval_gettext "The location \\\`\\\$ACTIONVAL' is not valid."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| fi |
| |
| # Remove directory from the directory stack. |
| popd > /dev/null |
| |
| elif [[ -f ${ACTIONVAL} ]];then |
| |
| # Add directory to the top of the directory stack. |
| pushd "$(dirname $ACTIONVAL)" > /dev/null |
| |
| # Check directory existence inside the repository. |
| if [[ $(pwd) =~ '^/home/centos/artwork' ]];then |
| # Re-define source value using absolute path. |
| ACTIONVAL=$(pwd)/$(basename $ACTIONVAL) |
| else |
| cli_printMessage "`eval_gettext "The location \\\`\\\$ACTIONVAL' is not valid."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| fi |
| |
| |
| popd > /dev/null |
| |
| else |
| |
| |
| |
| |
| |
| cli_printMessage "`eval_gettext "The location \\\`\\\$ACTIONVAL' is not valid."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| |
| fi |
| |
| } |
| |