Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # This script checks out all repositories from upstream and pushes master |
| 4 | # to the origin repo on Linaro's Git server, rebasing all local branches, |
| 5 | # but *not* pushing them, too. |
| 6 | |
| 7 | . llvm-common |
| 8 | |
| 9 | function repo_sync () { |
| 10 | if [ ! -d $2 ]; then return; fi |
| 11 | echo " + Updating $1" |
| 12 | cd $2 |
| 13 | branch=`get_branch` |
| 14 | safe_run git-refresh |
| 15 | safe_run git-rebase-all $branch |
| 16 | } |
| 17 | |
| 18 | prog=`basename $0` |
| 19 | syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]" |
| 20 | rt=false |
| 21 | libs=false |
| 22 | linker=false |
| 23 | debug=false |
| 24 | tests=false |
| 25 | web=false |
| 26 | |
| 27 | while getopts "rlkdtwa" opt; do |
| 28 | case $opt in |
| 29 | r) |
| 30 | rt=true |
| 31 | ;; |
| 32 | l) |
| 33 | libs=true |
| 34 | ;; |
| 35 | k) |
| 36 | linker=true |
| 37 | ;; |
| 38 | d) |
| 39 | debug=true |
| 40 | ;; |
| 41 | t) |
| 42 | tests=true |
| 43 | ;; |
| 44 | w) |
| 45 | web=true |
| 46 | ;; |
| 47 | a) |
| 48 | rt=true |
| 49 | libs=true |
| 50 | linker=true |
| 51 | debug=true |
| 52 | tests=true |
| 53 | ;; |
| 54 | *) |
| 55 | echo $syntax |
| 56 | exit 1 |
| 57 | ;; |
| 58 | esac |
| 59 | done |
| 60 | |
| 61 | # Compulsory updates |
| 62 | repo_sync LLVM $LLVM_SRC |
| 63 | repo_sync Clang $LLVM_SRC/../clang |
| 64 | |
| 65 | # Optional updates |
| 66 | if $rt; then |
| 67 | repo_sync RT $LLVM_SRC/../compiler-rt |
| 68 | fi |
| 69 | |
| 70 | if $libs; then |
| 71 | repo_sync LibC++ $LLVM_SRC/../libcxx |
| 72 | repo_sync LibC++ABI $LLVM_SRC/../libcxxabi |
| 73 | repo_sync LibUnwind $LLVM_SRC/../libunwind |
| 74 | fi |
| 75 | |
| 76 | if $linker; then |
| 77 | repo_sync Linker $LLVM_SRC/../lld |
| 78 | fi |
| 79 | |
| 80 | if $debug; then |
| 81 | repo_sync Debugger $LLVM_SRC/../lldb |
| 82 | fi |
| 83 | |
| 84 | if $tests; then |
| 85 | repo_sync Test-Suite $LLVM_SRC/../test-suite |
| 86 | repo_sync LNT $LLVM_SRC/../lnt |
| 87 | repo_sync Zorg $LLVM_SRC/../zorg |
| 88 | fi |
| 89 | |
| 90 | # These are pure SVN repos, not enabled with -a |
| 91 | # You have to manually force with -w |
| 92 | if $web; then |
| 93 | if [ -d $LLVM_SRC/../www ]; then |
| 94 | echo " + Updating WWW" |
| 95 | cd $LLVM_SRC/../www |
| 96 | svn up |
| 97 | fi |
| 98 | if [ -d $LLVM_SRC/../pubs ]; then |
| 99 | echo " + Updating Pubs" |
| 100 | cd $LLVM_SRC/../pubs |
| 101 | svn up |
| 102 | fi |
| 103 | fi |