From 5e573e339a72c6335995fbbef849479f32fa4179 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 23 Jan 2012 12:39:59 +0100 Subject: [PATCH] implement CVS support; as it leaks many features, only authentication to pserver is supported --- libraries/repositories | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/libraries/repositories b/libraries/repositories index 03cc4cb..a3c96f2 100644 --- a/libraries/repositories +++ b/libraries/repositories @@ -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 ;;