blob: 5d5cb276b46911395402bb6041f09bef29adf74a [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 () {
Diana Picus09cd9b62016-04-25 18:04:06 +030010 if [ ! -d $2 ]; then
11 echo " + Not updating $1 (couldn't find source directory)"
12 return;
13 fi
Renato Golin94cc1042016-04-26 11:02:23 +010014 echo " + Updating $1"
15 cd $2
16 branch=`get_branch`
17 safe_run git-refresh
18 safe_run git-rebase-all $branch
19}
20
21prog=`basename $0`
Diana Picus3124fb82016-04-25 15:37:25 +030022syntax="Syntax: $prog [-clang-tools-e(x)tra] [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]"
23cextra=false
Renato Golin94cc1042016-04-26 11:02:23 +010024rt=false
25libs=false
26linker=false
27debug=false
28tests=false
29web=false
30
Diana Picus3124fb82016-04-25 15:37:25 +030031while getopts "xrlkdtwa" opt; do
Renato Golin94cc1042016-04-26 11:02:23 +010032 case $opt in
Diana Picus3124fb82016-04-25 15:37:25 +030033 x)
34 cextra=true
35 ;;
Renato Golin94cc1042016-04-26 11:02:23 +010036 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 Picus3124fb82016-04-25 15:37:25 +030055 cextra=true
Renato Golin94cc1042016-04-26 11:02:23 +010056 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
67done
68
69# Compulsory updates
70repo_sync LLVM $LLVM_SRC
71repo_sync Clang $LLVM_SRC/../clang
72
73# Optional updates
Diana Picus3124fb82016-04-25 15:37:25 +030074if $cextra; then
75 repo_sync ClangToolsExtra $LLVM_SRC/../clang-tools-extra
76fi
77
Renato Golin94cc1042016-04-26 11:02:23 +010078if $rt; then
79 repo_sync RT $LLVM_SRC/../compiler-rt
80fi
81
82if $libs; then
83 repo_sync LibC++ $LLVM_SRC/../libcxx
84 repo_sync LibC++ABI $LLVM_SRC/../libcxxabi
85 repo_sync LibUnwind $LLVM_SRC/../libunwind
86fi
87
88if $linker; then
89 repo_sync Linker $LLVM_SRC/../lld
90fi
91
92if $debug; then
93 repo_sync Debugger $LLVM_SRC/../lldb
94fi
95
96if $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
100fi
101
102# These are pure SVN repos, not enabled with -a
103# You have to manually force with -w
104if $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
115fi