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
|
|
|
|
|
2016-12-15 04:45:04 -05:00
|
|
|
OSMIUM_REPO="https://github.com/osmcode/libosmium.git"
|
2017-08-30 05:28:41 -04:00
|
|
|
OSMIUM_TAG=v2.13.1
|
2015-08-19 13:26:07 -04:00
|
|
|
|
2016-12-15 04:45:04 -05:00
|
|
|
VARIANT_REPO="https://github.com/mapbox/variant.git"
|
2017-07-18 17:08:05 -04:00
|
|
|
VARIANT_TAG=v1.1.3
|
2015-08-19 13:26:07 -04:00
|
|
|
|
2016-12-06 09:13:11 -05:00
|
|
|
SOL_REPO="https://github.com/ThePhD/sol2.git"
|
2017-07-18 17:08:05 -04:00
|
|
|
SOL_TAG=v2.17.5
|
2016-12-06 09:13:11 -05:00
|
|
|
|
2017-05-23 10:51:09 -04:00
|
|
|
RAPIDJSON_REPO="https://github.com/miloyip/rapidjson.git"
|
|
|
|
RAPIDJSON_TAG=v1.1.0
|
|
|
|
|
2016-12-15 04:45:04 -05:00
|
|
|
VARIANT_LATEST=$(curl "https://api.github.com/repos/mapbox/variant/releases/latest" | jq ".tag_name")
|
|
|
|
OSMIUM_LATEST=$(curl "https://api.github.com/repos/osmcode/libosmium/releases/latest" | jq ".tag_name")
|
2016-12-06 09:13:11 -05:00
|
|
|
SOL_LATEST=$(curl "https://api.github.com/repos/ThePhD/sol2/releases/latest" | jq ".tag_name")
|
2017-05-23 10:51:09 -04:00
|
|
|
RAPIDJSON_LATEST=$(curl "https://api.github.com/repos/miloyip/rapidjson/releases/latest" | jq ".tag_name")
|
2015-08-19 13:26:07 -04:00
|
|
|
|
2015-08-19 14:20:43 -04:00
|
|
|
echo "Latest osmium release is $OSMIUM_LATEST, pulling in \"$OSMIUM_TAG\""
|
|
|
|
echo "Latest variant release is $VARIANT_LATEST, pulling in \"$VARIANT_TAG\""
|
2016-12-06 09:13:11 -05:00
|
|
|
echo "Latest sol2 release is $SOL_LATEST, pulling in \"$SOL_TAG\""
|
2017-05-23 10:51:09 -04:00
|
|
|
echo "Latest rapidjson release is $RAPIDJSON_LATEST, pulling in \"$RAPIDJSON_TAG\""
|
2015-08-19 14:20:43 -04:00
|
|
|
|
2016-12-15 04:45:04 -05:00
|
|
|
read -p "Update osmium (y/n) " ok
|
|
|
|
if [[ $ok =~ [yY] ]]
|
|
|
|
then
|
|
|
|
if [ -d "third_party/libosmium" ]; then
|
|
|
|
git subtree pull -P third_party/libosmium/ $OSMIUM_REPO $OSMIUM_TAG --squash
|
|
|
|
else
|
|
|
|
git subtree add -P third_party/libosmium/ $OSMIUM_REPO $OSMIUM_TAG --squash
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
read -p "Update variant (y/n) " ok
|
|
|
|
if [[ $ok =~ [yY] ]]
|
|
|
|
then
|
|
|
|
if [ -d "third_party/variant" ]; then
|
|
|
|
git subtree pull -P third_party/variant/ $VARIANT_REPO $VARIANT_TAG --squash
|
|
|
|
else
|
|
|
|
git subtree add -P third_party/variant/ $VARIANT_REPO $VARIANT_TAG --squash
|
|
|
|
fi
|
|
|
|
fi
|
2015-08-19 14:20:43 -04:00
|
|
|
|
2016-12-15 04:45:04 -05:00
|
|
|
read -p "Update sol2 (y/n) " ok
|
|
|
|
if [[ $ok =~ [yY] ]]
|
|
|
|
then
|
|
|
|
if [ -d "third_party/sol2" ]; then
|
|
|
|
git subtree pull -P third_party/sol2/sol2/ $SOL_REPO $SOL_TAG --squash
|
|
|
|
else
|
|
|
|
git subtree add -P third_party/sol2/sol2/ $SOL_REPO $SOL_TAG --squash
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-05-23 10:51:09 -04:00
|
|
|
read -p "Update rapidjson (y/n) " ok
|
|
|
|
if [[ $ok =~ [yY] ]]
|
|
|
|
then
|
|
|
|
if [ -d "third_party/rapidjson" ]; then
|
|
|
|
git subtree pull -P third_party/rapidjson/ $RAPIDJSON_REPO $RAPIDJSON_TAG --squash
|
|
|
|
else
|
|
|
|
git subtree add -P third_party/rapidjson/ $RAPIDJSON_REPO $RAPIDJSON_TAG --squash
|
|
|
|
fi
|
|
|
|
fi
|