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 () { |
Diana Picus | 09cd9b6 | 2016-04-25 18:04:06 +0300 | [diff] [blame^] | 10 | if [ ! -d $2 ]; then |
| 11 | echo " + Not updating $1 (couldn't find source directory)" |
| 12 | return; |
| 13 | fi |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 14 | echo " + Updating $1" |
| 15 | cd $2 |
| 16 | branch=`get_branch` |
| 17 | safe_run git-refresh |
| 18 | safe_run git-rebase-all $branch |
| 19 | } |
| 20 | |
| 21 | prog=`basename $0` |
| 22 | syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]" |
| 23 | rt=false |
| 24 | libs=false |
| 25 | linker=false |
| 26 | debug=false |
| 27 | tests=false |
| 28 | web=false |
| 29 | |
| 30 | while getopts "rlkdtwa" opt; do |
| 31 | case $opt in |
| 32 | r) |
| 33 | rt=true |
| 34 | ;; |
| 35 | l) |
| 36 | libs=true |
| 37 | ;; |
| 38 | k) |
| 39 | linker=true |
| 40 | ;; |
| 41 | d) |
| 42 | debug=true |
| 43 | ;; |
| 44 | t) |
| 45 | tests=true |
| 46 | ;; |
| 47 | w) |
| 48 | web=true |
| 49 | ;; |
| 50 | a) |
| 51 | rt=true |
| 52 | libs=true |
| 53 | linker=true |
| 54 | debug=true |
| 55 | tests=true |
| 56 | ;; |
| 57 | *) |
| 58 | echo $syntax |
| 59 | exit 1 |
| 60 | ;; |
| 61 | esac |
| 62 | done |
| 63 | |
| 64 | # Compulsory updates |
| 65 | repo_sync LLVM $LLVM_SRC |
| 66 | repo_sync Clang $LLVM_SRC/../clang |
| 67 | |
| 68 | # Optional updates |
| 69 | if $rt; then |
| 70 | repo_sync RT $LLVM_SRC/../compiler-rt |
| 71 | fi |
| 72 | |
| 73 | if $libs; then |
| 74 | repo_sync LibC++ $LLVM_SRC/../libcxx |
| 75 | repo_sync LibC++ABI $LLVM_SRC/../libcxxabi |
| 76 | repo_sync LibUnwind $LLVM_SRC/../libunwind |
| 77 | fi |
| 78 | |
| 79 | if $linker; then |
| 80 | repo_sync Linker $LLVM_SRC/../lld |
| 81 | fi |
| 82 | |
| 83 | if $debug; then |
| 84 | repo_sync Debugger $LLVM_SRC/../lldb |
| 85 | fi |
| 86 | |
| 87 | if $tests; then |
| 88 | repo_sync Test-Suite $LLVM_SRC/../test-suite |
| 89 | repo_sync LNT $LLVM_SRC/../lnt |
| 90 | repo_sync Zorg $LLVM_SRC/../zorg |
| 91 | fi |
| 92 | |
| 93 | # These are pure SVN repos, not enabled with -a |
| 94 | # You have to manually force with -w |
| 95 | if $web; then |
| 96 | if [ -d $LLVM_SRC/../www ]; then |
| 97 | echo " + Updating WWW" |
| 98 | cd $LLVM_SRC/../www |
| 99 | svn up |
| 100 | fi |
| 101 | if [ -d $LLVM_SRC/../pubs ]; then |
| 102 | echo " + Updating Pubs" |
| 103 | cd $LLVM_SRC/../pubs |
| 104 | svn up |
| 105 | fi |
| 106 | fi |