buildrom. only set up for olpc right now.
[buildrom.git] / buildrom-devel / buildrom / bin / fetchsvn.sh
blob381f80bf6624263bb73c79fcfe3e97e0d11af14b
1 #!/bin/sh
2 # Check out or update a SVN repository
4 URL=$1
5 DIR=$2
6 REV=$3
8 BASE=`dirname $DIR`
10 # Simple case - the repository doesn't exist
12 if [ ! -d $DIR/.svn ]; then
13 (cd $BASE; \
14 svn co -r $REV $URL || {
15 echo "Couldn't get the repository."
16 exit 1
19 exit 0
22 CURREV=`svn info $DIR | grep "Last Changed Rev" | awk '{ print $4 }'`
24 if [ $CURREV -ne $REV ]; then
25 (cd $DIR; \
26 svn update -r $REV $URL || {
27 echo "Couldn't update the repository."
28 exit 1
31 exit 0