annotate scripts/repo_update_helper.sh @ 11:25dc41101f5d

exec_time_vs_task_size: data, results and graphs for xoanon
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 20 Jan 2012 14:16:45 +0100
parents
children
rev   line source
Me@0 1 #! /bin/sh
Me@0 2
Me@0 3 #finds all from the current point in the directory tree
Me@0 4 function find_repos()
Me@0 5 {
Me@0 6 FOUND_REPOS=$(find . -type d | grep -e ".hg$" | sed "s/\.hg//g")
Me@0 7 echo -e $FOUND_REPOS
Me@0 8 }
Me@0 9
Me@0 10 function print_info()
Me@0 11 {
Me@0 12 echo -e "\n>> $1"
Me@0 13 }
Me@0 14
Me@0 15 function update_repos()
Me@0 16 {
Me@0 17 if [ -z "$1" ]
Me@0 18 then
Me@0 19 TAG="tip"
Me@0 20 else
Me@0 21 TAG=$1
Me@0 22 fi
Me@0 23 REPOS=$( cat << EOF
Me@0 24 ./
Me@0 25 ./src/VPThread_lib/
Me@0 26 ./src/VPThread_lib/VMS/
Me@0 27 ./src/VPThread_lib/VMS/DynArray/
Me@0 28 ./src/VPThread_lib/VMS/Histogram/
Me@0 29 ./src/VPThread_lib/VMS/Queue_impl/
Me@0 30 ./src/VPThread_lib/VMS/Hash_impl/
Me@0 31 EOF
Me@0 32 )
Me@0 33
Me@0 34 BASE_DIR=$(pwd)
Me@0 35
Me@0 36 for DIR in $REPOS
Me@0 37 do
Me@0 38 cd $DIR
Me@0 39 hg pull
Me@0 40 hg update $TAG
Me@0 41 if [ $? -ne 0 ]
Me@0 42 then
Me@0 43 echo ">> Falling back from Tag to V0 checkout"
Me@0 44 hg update V0
Me@0 45 if [ $? -ne 0 ]
Me@0 46 then
Me@0 47 echo ">> Falling back from Tag to Tip checkout"
Me@0 48 hg update tip
Me@0 49 fi
Me@0 50 fi
Me@0 51 cd $BASE_DIR
Me@0 52 done
Me@0 53 }