summaryrefslogtreecommitdiff
path: root/checkoutSource.sh
blob: 6d2346ecc1f6cb10b844413901cc84bcba7cde57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
set -e
source setEnv.sh
source cleanUp.sh

export llvmsvn=http://llvm.org/svn/llvm-project/llvm/trunk
export clangsvn=http://llvm.org/svn/llvm-project/cfe/trunk
export lldbsvn=http://llvm.org/svn/llvm-project/lldb/trunk

if [ "$1" == "" ]; then
    export rev=HEAD
else
    export rev=$1
fi

function svnFunc {
  if [ -d "$1/.svn" ]; then
      svn cleanup $1
      svn update --non-interactive --no-auth-cache --revision $rev $1
  else
      svn checkout --non-interactive --no-auth-cache --revision $rev $2@$rev $1
  fi
}

svnFunc $llvmDir $llvmsvn
svnFunc $clangDir $clangsvn
svnFunc $lldbDir $lldbsvn