From cf21a7e4717e12a00ae3a4d761dbc5b56b976972 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 9 Jan 2012 19:09:26 +0100 Subject: [PATCH] implement synchronizeRepository() --- libraries/repositories | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libraries/repositories b/libraries/repositories index 8f184e0..b142dd7 100644 --- a/libraries/repositories +++ b/libraries/repositories @@ -70,3 +70,25 @@ function makeSshWrapper() { export SVN_SSH="${BINDIR}/ssh_wrapper.sh" return 0 } + +#------------------------------------------------------------------------------- +# Synchronizes specified repository regardless its protocol +# Parameters: %dest_directory% %protocol% %address% [%branch%] +#------------------------------------------------------------------------------- +function synchronizeRepository() { + for ((i=0; $i<${FETCHTRIES}; i++)); do + case "${2}" in + git|GIT) + checkoutGit $1 $3 $4 && return 0 + ;; + rsync|RSYNC) + checkoutRsync $1 $3 && return 0 + ;; + svn|SVN) + checkoutSubversion $1 $3 && return 0 + ;; + esac + sleep ${FETCHTIMEOUT} + done + return 1 +}