annotate SCRIPTS/update-all.sh @ 118:770eb830ec19 emscripten

Typo fix
author Chris Cannam
date Wed, 18 May 2016 16:14:08 +0100
parents 793467b5e61c
children
rev   line source
Chris@0 1 #!/bin/bash
Chris@6 2
Chris@100 3 set -eu
Chris@100 4
Chris@6 5 # Run this from the top-level vamp-build-and-test directory
Chris@6 6
Chris@100 7 failed=/tmp/failed_$$
Chris@100 8 rm -f "$failed"
Chris@100 9 trap "rm -f $failed" 0
Chris@100 10
Chris@100 11 cat METADATA/repos.txt | grep -v '^#' | awk -F= '{ print $1, $2 }' |
Chris@100 12 while read name loc; do
Chris@100 13 if [ -d "$name"/.hg ]; then
Chris@100 14 ( cd $name ; hg pull && hg update ) || echo "$name" >> "$failed"
Chris@100 15 elif [ -d "$name"/.git ]; then
Chris@100 16 ( cd $name ; git pull ) || echo "$name" >> "$failed"
Chris@100 17 elif [ -d "$name" ]; then
Chris@100 18 echo "ERROR: Directory \"$name\" exists, but is not a git or hg repo" 1>&2
Chris@100 19 exit 1
Chris@100 20 else
Chris@100 21 case "$loc" in
Chris@100 22 */hg/*)
Chris@100 23 hg clone "$loc" "$name" || echo "$name" >> "$failed";;
Chris@100 24 *//git*)
Chris@100 25 git clone "$loc" "$name" || echo "$name" >> "$failed";;
Chris@100 26 *)
Chris@100 27 echo "ERROR: Can't deduce repo type from URL \"$loc\"" 1>&2
Chris@100 28 exit 1;;
Chris@100 29 esac
Chris@100 30 fi
Chris@100 31 done
Chris@100 32
Chris@100 33 echo "Done"
Chris@100 34 if [ -f "$failed" ]; then
Chris@100 35 echo "Failed repos:"
Chris@100 36 cat "$failed"
Chris@100 37 fi