| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function vcs { |
| |
| local ACTIONNAM='' |
| local ACTIONNAMS='' |
| local ACTIONVAL='' |
| |
| |
| |
| local ENABLED=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "enabled") |
| if [[ ! ${ENABLED} =~ '^(yes|ye|y|0)$' ]];then |
| return |
| fi |
| |
| |
| local PACKAGE=$(cli_getConfigValue "${CLI_BASEDIR}/${CLI_NAME}.conf" "version_control" "package") |
| |
| |
| if [[ ${PACKAGE} =~ '^(git|subversion)$' ]];then |
| |
| |
| |
| case ${PACKAGE} in |
| |
| 'git' ) |
| COMMAND=/usr/bin/git |
| ;; |
| |
| 'subversion' ) |
| COMMAND=/usr/bin/svn |
| ;; |
| esac |
| |
| else |
| cli_printMessage "${PACKAGE} `gettext "isn't supported as version control system."`" --as-error-line |
| fi |
| |
| # Verify whether the related package is installed or not. |
| cli_checkFiles ${PACKAGE} --is-installed |
| |
| # Interpret arguments and options passed through command-line. |
| vcs_getOptions |
| |
| # Initialize function specific export id. |
| local EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${PACKAGE} -d)/$(cli_getRepoName ${PACKAGE} -f)" |
| |
| # Export specific functionalities to the script environment. |
| cli_exportFunctions "${EXPORTID}" |
| |
| # Execute version control. |
| ${PACKAGE} |
| |
| # Unset specific functionalities from the script environment. |
| cli_unsetFunctions "${EXPORTID}" |
| |
| } |
| |