implement CVS support; as it leaks many features, only authentication to pserver is supported

This commit is contained in:
belliash 2012-01-23 12:39:59 +01:00
parent 30b0cf02f6
commit 5e573e339a
1 changed files with 28 additions and 1 deletions

View File

@ -60,11 +60,35 @@ function mirrorRsync() {
function prepareWrappers() {
run "cp ${EZROOT}/files/ssh_wrapper.sh ${BINDIR}/ssh_wrapper.sh" || return 1
run "chmod +x ${BINDIR}/ssh_wrapper.sh" || return 1
export CVS_PASSFILE="${TEMPDIR}/cvspass"
export GIT_SSH="${BINDIR}/ssh_wrapper.sh"
export SVN_SSH="${BINDIR}/ssh_wrapper.sh"
return 0
}
#-------------------------------------------------------------------------------
# Downloads or updates specified CVS repository
# Parameters: %dest_directory% %address% %module%
#-------------------------------------------------------------------------------
function pullCvs() {
local DIRECTORY="${1}"
local ADDRESS="${2}"
local MODULE="${3}"
if [ -d ${DIRECTORY} ]; then
cd ${DIRECTORY}
run "cvs update" || return 1
else
touch ${CVS_PASSFILE}
cd ${TEMPDIR}
run "cvs -q -f -z3 -d:pserver:anonymous:@${ADDRESS} login" || return 1
run "cvs -q -f -z3 -d:pserver:anonymous@${ADDRESS} checkout \
-P ${MODULE}" || return 1
run "mv ${MODULE} ${DIRECTORY}" || return 1
rm -f ${CVS_PASSFILE}
fi
return 0
}
#-------------------------------------------------------------------------------
# Downloads or updates specified GIT repository
# Parameters: %dest_directory% %address% [%branch%]
@ -115,11 +139,14 @@ function pullMercurial() {
#-------------------------------------------------------------------------------
# Synchronizes specified repository regardless its protocol
# Parameters: %dest_directory% %protocol% %address% [%branch%]
# Parameters: %dest_directory% %protocol% %address% [%branch%/%module%]
#-------------------------------------------------------------------------------
function pullRepository() {
for ((i=0; $i<${FETCHTRIES}; i++)); do
case "${2}" in
[Cc][Vv][Ss])
pullCvs "${1}" "${3}" "${4}" && return 0
;;
[Gg][Ii][Tt])
pullGit "${1}" "${3}" "${4}" && return 0
;;