forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate_dependencies.sh
executable file
·58 lines (44 loc) · 1.46 KB
/
update_dependencies.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
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# Note: once the subtree merge from this script has been committed and pushed to
# a branch do not attempt to rebase the branch back onto master or the subdirectory
# structure will be lost.
# http://git.661346.n2.nabble.com/subtree-merges-lose-prefix-after-rebase-td7332850.html
OSMIUM_PATH="osmcode/libosmium"
OSMIUM_TAG=v2.14.0
VARIANT_PATH="mapbox/variant"
VARIANT_TAG=v1.1.3
SOL_PATH="ThePhD/sol2"
SOL_TAG=v2.17.5
RAPIDJSON_PATH="Tencent/rapidjson"
RAPIDJSON_TAG=v1.1.0
MICROTAR_PATH="rxi/microtar"
MICROTAR_TAG=v0.1.0
PROTOZERO_PATH="mapbox/protozero"
PROTOZERO_TAG=v1.6.2
VTZERO_PATH="mapbox/vtzero"
VTZERO_TAG=v1.0.1
function update_subtree () {
name=${1^^}
path=$(tmpvar=${name}_PATH && echo ${!tmpvar})
tag=$(tmpvar=${name}_TAG && echo ${!tmpvar})
dir=$(basename $path)
repo="https://github.com/${path}.git"
latest=$(curl -s "https://api.github.com/repos/${path}/releases/latest" | jq ".tag_name")
echo "Latest $1 release is ${latest}, pulling in \"${tag}\""
read -p "Update ${1} (y/n) " ok
if [[ $ok =~ [yY] ]]
then
if [ -d "third_party/$dir" ]; then
git subtree pull -P third_party/$dir ${repo} ${tag} --squash
else
git subtree add -P third_party/$dir ${repo} ${tag} --squash
fi
fi
}
## Update dependencies
for dep in osmium variant sol rapidjson microtar protozero vtzero ; do
update_subtree $dep
done