forked from vsimon/webrtcbuilds-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.sh
executable file
·74 lines (60 loc) · 1.31 KB
/
checkout.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
#!/bin/bash
set -eo pipefail
set -x
# This checks out a specific revision
# win deps: depot_tools
# lin deps: depot_tools
# osx deps: depot_tools
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/environment.sh
usage ()
{
cat << EOF
usage:
$0 options
Checkout script.
OPTIONS:
-h Show this message
-d Top level build dir
-r Revision represented as a git SHA (optional, checks out latest revision if omitted)
EOF
}
while getopts :d:r: OPTION
do
case $OPTION in
d)
BUILD_DIR=$OPTARG
;;
r)
REVISION=$OPTARG
;;
?)
usage
exit 1
;;
esac
done
if [ -z "$BUILD_DIR" ]; then
usage
exit 1
fi
if [ -z $REVISION ]; then
# If no revision given, then get the latest revision from git ls-remote
REVISION=`git ls-remote $REPO_URL HEAD | cut -f1`
fi
# gclient only works from the build directory
pushd $BUILD_DIR
if [ -z $USE_PICKLE ]; then
# first fetch
if [ $PLATFORM = 'android' ]; then
fetch webrtc_android
else
fetch webrtc
fi
else
curl -L -O --silent https://github.com/vsimon/webrtcbuilds-builder/releases/download/pickle/pickle.tar.gz.0[0-5]
cat pickle.tar.gz.* | tar xzpf -
fi
# check out the specific revision after fetch
gclient sync --force --revision $REVISION
popd