osrm-backend/scripts/update_dependencies.sh

62 lines
1.6 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2016-10-18 17:05:20 -04:00
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
2018-04-19 05:41:33 -04:00
OSMIUM_PATH="osmcode/libosmium"
2024-09-28 14:35:05 -04:00
OSMIUM_TAG=v2.20.0
2018-04-19 05:41:33 -04:00
SOL_PATH="ThePhD/sol2"
2024-05-28 15:23:51 -04:00
SOL_TAG=v3.3.0
2018-04-19 05:41:33 -04:00
RAPIDJSON_PATH="Tencent/rapidjson"
2024-05-27 02:31:59 -04:00
RAPIDJSON_TAG=f9d53419e912910fd8fa57d5705fa41425428c35
2018-04-19 05:41:33 -04:00
MICROTAR_PATH="rxi/microtar"
2018-03-13 10:14:13 -04:00
MICROTAR_TAG=v0.1.0
2018-04-19 05:41:33 -04:00
PROTOZERO_PATH="mapbox/protozero"
PROTOZERO_TAG=v1.7.1
2018-04-19 05:41:33 -04:00
VTZERO_PATH="mapbox/vtzero"
VTZERO_TAG=v1.1.0
2018-04-19 05:41:33 -04:00
FMT_PATH="fmtlib/fmt"
FMT_TAG=v10.2.1
FLATBUFFERS_PATH="google/flatbuffers"
FLATBUFFERS_TAG=v24.3.25
2018-04-19 05:41:33 -04:00
function update_subtree () {
name=$(echo "$1" | tr '[:lower:]' '[:upper:]')
2018-04-19 05:41:33 -04:00
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 sol rapidjson microtar protozero vtzero fmt flatbuffers; do
2018-04-19 05:41:33 -04:00
update_subtree $dep
done