This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
checkout-all.sh
executable file
·88 lines (65 loc) · 2.58 KB
/
checkout-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
# Checkout script for the RISC-V tool chain
# Copyright (C) 2009, 2013, 2014, 2015, 2016, 2017 Embecosm Limited
# Contributor Jeremy Bennett <[email protected]>
# This file is part of the Embecosm GNU toolchain build system for RISC-V.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# This file is part of the Embecosm LLVM build system for AAP.
# Invocation Syntax
# checkout-all.sh [--pull]
# Argument meanings:
# --pull Pull the respositories as well as checking them out.
# Parse arg
if [ \( $# = 1 \) -a \( "x$1" = "x--pull" \) ]
then
do_pull="yes"
else
do_pull="no"
fi
# Set the top level directory.
topdir=$(cd $(dirname $0)/..;pwd)
repos="binutils:master \
gcc:embecosm-stable \
gdb:riscv-next \
newlib:bare-metal-hack \
dejagnu:riscv-dejagnu-1.6 \
gdbserver:master \
picorv32:gdbserver \
ri5cy:verilator-model \
riscv-pk:master \
riscv-fesvr:master \
riscv-isa-sim:master \
beebs:picorv32 \
riscv-tests:master \
berkeley-softfloat-3:master \
berkeley-testfloat-3:master"
for r in ${repos}
do
tool=$(echo ${r} | cut -d ':' -f 1)
branch=$(echo ${r} | cut -d ':' -f 2)
cd ${topdir}/${tool}
# Ignore failed fetches (may be offline)
printf "%-14s fetching... " "${tool}:"
git fetch --all > /dev/null 2>&1 || true
# Checkout the branch. Not sure what happens if the branch is in mutliple
# remotes.
echo -n "checking out ${branch} ... "
git checkout ${branch} > /dev/null 2>&1 || true
# Pull to the latest if requested.
if [ ${do_pull} = "yes" ]
then
echo -n "pulling..."
git pull > /dev/null 2>&1 || true
fi
# Repo done
echo
done