implement synchronizeRepository()

This commit is contained in:
belliash 2012-01-09 19:09:26 +01:00
parent fbbc7d8665
commit cf21a7e471
1 changed files with 22 additions and 0 deletions

View File

@ -70,3 +70,25 @@ function makeSshWrapper() {
export SVN_SSH="${BINDIR}/ssh_wrapper.sh" export SVN_SSH="${BINDIR}/ssh_wrapper.sh"
return 0 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
}