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` |
Diana Picus | 3124fb8 | 2016-04-25 15:37:25 +0300 | [diff] [blame] | 22 | syntax="Syntax: $prog [-clang-tools-e(x)tra] [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]" |
| 23 | cextra=false |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 24 | rt=false |
| 25 | libs=false |
| 26 | linker=false |
| 27 | debug=false |
| 28 | tests=false |
| 29 | web=false |
| 30 | |
Diana Picus | 3124fb8 | 2016-04-25 15:37:25 +0300 | [diff] [blame] | 31 | while getopts "xrlkdtwa" opt; do |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 32 | case $opt in |
Diana Picus | 3124fb8 | 2016-04-25 15:37:25 +0300 | [diff] [blame] | 33 | x) |
| 34 | cextra=true |
| 35 | ;; |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 36 | r) |
| 37 | rt=true |
| 38 | ;; |
| 39 | l) |
| 40 | libs=true |
| 41 | ;; |
| 42 | k) |
| 43 | linker=true |
| 44 | ;; |
| 45 | d) |
| 46 | debug=true |
| 47 | ;; |
| 48 | t) |
| 49 | tests=true |
| 50 | ;; |
| 51 | w) |
| 52 | web=true |
| 53 | ;; |
| 54 | a) |
Diana Picus | 3124fb8 | 2016-04-25 15:37:25 +0300 | [diff] [blame] | 55 | cextra=true |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 56 | rt=true |
| 57 | libs=true |
| 58 | linker=true |
| 59 | debug=true |
| 60 | tests=true |
| 61 | ;; |
| 62 | *) |
| 63 | echo $syntax |
| 64 | exit 1 |
| 65 | ;; |
| 66 | esac |
| 67 | done |
| 68 | |
| 69 | # Compulsory updates |
| 70 | repo_sync LLVM $LLVM_SRC |
| 71 | repo_sync Clang $LLVM_SRC/../clang |
| 72 | |
| 73 | # Optional updates |
Diana Picus | 3124fb8 | 2016-04-25 15:37:25 +0300 | [diff] [blame] | 74 | if $cextra; then |
| 75 | repo_sync ClangToolsExtra $LLVM_SRC/../clang-tools-extra |
| 76 | fi |
| 77 | |
Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 78 | if $rt; then |
| 79 | repo_sync RT $LLVM_SRC/../compiler-rt |
| 80 | fi |
| 81 | |
| 82 | if $libs; then |
| 83 | repo_sync LibC++ $LLVM_SRC/../libcxx |
| 84 | repo_sync LibC++ABI $LLVM_SRC/../libcxxabi |
| 85 | repo_sync LibUnwind $LLVM_SRC/../libunwind |
| 86 | fi |
| 87 | |
| 88 | if $linker; then |
| 89 | repo_sync Linker $LLVM_SRC/../lld |
| 90 | fi |
| 91 | |
| 92 | if $debug; then |
| 93 | repo_sync Debugger $LLVM_SRC/../lldb |
| 94 | fi |
| 95 | |
| 96 | if $tests; then |
| 97 | repo_sync Test-Suite $LLVM_SRC/../test-suite |
| 98 | repo_sync LNT $LLVM_SRC/../lnt |
| 99 | repo_sync Zorg $LLVM_SRC/../zorg |
| 100 | fi |
| 101 | |
| 102 | # These are pure SVN repos, not enabled with -a |
| 103 | # You have to manually force with -w |
| 104 | if $web; then |
| 105 | if [ -d $LLVM_SRC/../www ]; then |
| 106 | echo " + Updating WWW" |
| 107 | cd $LLVM_SRC/../www |
| 108 | svn up |
| 109 | fi |
| 110 | if [ -d $LLVM_SRC/../pubs ]; then |
| 111 | echo " + Updating Pubs" |
| 112 | cd $LLVM_SRC/../pubs |
| 113 | svn up |
| 114 | fi |
| 115 | fi |