diff options
-rwxr-xr-x | toolchain-tools | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/toolchain-tools b/toolchain-tools deleted file mode 100755 index 31dc352..0000000 --- a/toolchain-tools +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash -# -# This script is used to sync the upstream gcc repository, plus a series of -# other related toolchain repositories. -# -# It is highly dependant on the git setup Linaro has on its server. Setup that -# is done with gitolite and gitweb. -# -# How the mirrorin has been done: -# - mirrorin happens in /srv/mirror on the server -# - depending on the mirror type, we can create a git-svn clone in a separate -# directory, add a new remote on the "original" repo, and then make sure -# everything is pushed to the real bare repo. -# -# For more info: https://wiki.linaro.org/Platform/Systems/ToolchainsMirror -# - -umask 0022 # cron runs us with 0002 - -GITOLITE_BIN="/home/git/bin/gitolite" -REPOSITORIES_DIR="/srv/repositories" -TOOLCHAIN_DIR="$REPOSITORIES_DIR/toolchain" -GCC_REPO="$TOOLCHAIN_DIR/gcc.git" -BINUTILS_GDB_REPO="$TOOLCHAIN_DIR/binutils-gdb.git" -MIRROR_DIR="/srv/mirror" - - -function errcho() { - # Print on stderr passed messages. - >&2 echo $1 -} - -function logiferr() { - LOG=$("$@" 2>&1) - STATUS=$? - if [ ${STATUS} != 0 ] - then - errcho "CMD: '$@' exited with status ${STATUS}" - if [ "${LOG}" != "" ] - then - errcho "WITH LOG OUTPUT: ${LOG}" - fi - fi - return ${STATUS} -} - -# Retry command which tends to have transient failures -function stubborn_do() { - for i in 5 15 60 180 180; do - LOG=$("$@" 2>&1) - STATUS=$? - if [ $STATUS -eq 0 ]; then - return 0 - fi - sleep $i - done - errcho "CMD: '$@' exited with status $STATUS" - errcho "WITH LOG OUTPUT: '$LOG'" - errcho "Last retry delay: ${i}s" - return $STATUS -} - -function new2_gcc() { - if [ ! -d $MIRROR_DIR/gcc-upstream-pristine.git ]; then - git clone --mirror git://gcc.gnu.org/git/gcc.git $MIRROR_DIR/gcc-upstream-pristine.git - fi - - QUIET="${QUIET---quiet}" - cd $MIRROR_DIR/gcc-upstream-pristine.git - stubborn_do git fetch $QUIET - # Set up gitolite environment for local push - export GL_BYPASS_ACCESS_CHECKS=1 - export GL_LIBDIR=~/gitolite/src/lib - git push $QUIET --force /srv/repositories/toolchain/gcc.git 'refs/heads/*' 'refs/tags/*' 2>&1 | grep -v "remote: Sending notification emails to" -} - -function update_newlib_mirror() { - cd $TOOLCHAIN_DIR/newlib.git - stubborn_do git remote update -} - -function update_glibc_mirror() { - cd $TOOLCHAIN_DIR/glibc.git - stubborn_do git remote update -} - -function update_binutils_gdb() { - cd $BINUTILS_GDB_REPO - stubborn_do git remote update -} - -function update_dejagnu_mirror() { - cd "$MIRROR_DIR/dejagnu.git" - stubborn_do git remote update - if [ $? == 0 ] - then - logiferr $GITOLITE_BIN push --force origin 'refs/heads/*' 'refs/tags/*' - fi -} - -function all() { - update_binutils_gdb -} - -$@ - -all_repos="gcc.git glibc.git dejagnu.git newlib.git binutils-gdb.git" -cd /srv/repositories -for repo in $all_repos ; do - logiferr /usr/local/bin/grok-manifest -m /var/www/git.linaro.org/manifest.js.gz -t /srv/repositories/ -v -n toolchain/$repo - logiferr git --git-dir=$TOOLCHAIN_DIR/$repo update-server-info -done |