2015-08-19 13:26:07 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-10-18 17:05:20 -04:00
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
set -o nounset
|
|
|
|
|
2016-10-03 13:51:30 -04:00
|
|
|
# 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
|
2015-08-19 13:26:07 -04:00
|
|
|
|
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
|
2016-12-06 09:13:11 -05:00
|
|
|
|
2018-04-19 05:41:33 -04:00
|
|
|
RAPIDJSON_PATH="Tencent/rapidjson"
|
2024-05-27 02:31:59 -04:00
|
|
|
RAPIDJSON_TAG=f9d53419e912910fd8fa57d5705fa41425428c35
|
2017-05-23 10:51:09 -04:00
|
|
|
|
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"
|
2024-09-28 14:35:20 -04:00
|
|
|
PROTOZERO_TAG=v1.7.1
|
2018-04-19 05:41:33 -04:00
|
|
|
|
|
|
|
VTZERO_PATH="mapbox/vtzero"
|
2024-05-07 16:19:48 -04:00
|
|
|
VTZERO_TAG=v1.1.0
|
2018-04-19 05:41:33 -04:00
|
|
|
|
2024-05-07 14:55:55 -04:00
|
|
|
FMT_PATH="fmtlib/fmt"
|
2024-05-07 16:19:48 -04:00
|
|
|
FMT_TAG=v10.2.1
|
2024-05-07 14:55:55 -04:00
|
|
|
|
2024-07-10 14:44:36 -04:00
|
|
|
FLATBUFFERS_PATH="google/flatbuffers"
|
|
|
|
FLATBUFFERS_TAG=v24.3.25
|
|
|
|
|
2018-04-19 05:41:33 -04:00
|
|
|
function update_subtree () {
|
2024-05-24 14:39:45 -04:00
|
|
|
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
|
2024-07-10 14:44:36 -04:00
|
|
|
for dep in osmium sol rapidjson microtar protozero vtzero fmt flatbuffers; do
|
2018-04-19 05:41:33 -04:00
|
|
|
update_subtree $dep
|
|
|
|
done
|