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