blob: 1e0b71de8417855847bb9c8b965aada6b39dfd17 [file] [log] [blame]
# © 2016 and later: Unicode, Inc. and others.
# License & terms of use:
if [[ -z $1 ]]; then
echo "Pass the current version tag of double-conversion as the first argument to this script";
echo "To pull the latest changes, use 'master'"
exit 1;
upstream_root="$(dirname "$0")/upstream";
icu4c_i18n_root="$(dirname "$0")/../../icu4c/source/i18n";
echo "Will download $url";
echo "Will expand into $upstream_root";
read -p "Press Enter to continue or s to skip: " ch;
if [ "$ch" != "s" ]; then
rm -f $filename;
wget $url;
rm -r "$upstream_root"; # in case any files were deleted in the new version
mkdir "$upstream_root";
tar zxf $filename --strip 1 -C "$upstream_root";
rm $filename;
echo "upstream updated and $filename removed";
echo "Will apply diffs to $icu4c_i18n_root";
read -p "Press Enter to continue or s to skip: " ch;
do_patch() {
git diff --patch "$vendor_path" | patch --merge "$icu4c_path";
do_patch_prefix_extension() {
do_patch "$1.$2" "double-conversion-$1.$3";
do_patch_extension() {
do_patch "$1.$2" "$1.$3";
if [ "$ch" != "s" ]; then
do_patch_prefix_extension bignum-dtoa cc cpp;
do_patch_prefix_extension bignum-dtoa h h;
do_patch_prefix_extension bignum cc cpp;
do_patch_prefix_extension bignum h h;
do_patch_prefix_extension cached-powers cc cpp;
do_patch_prefix_extension cached-powers h h;
do_patch_prefix_extension diy-fp cc cpp;
do_patch_prefix_extension diy-fp h h;
do_patch_prefix_extension fast-dtoa cc cpp;
do_patch_prefix_extension fast-dtoa h h;
do_patch_prefix_extension ieee h h;
do_patch_prefix_extension utils h h;
do_patch_extension double-conversion cc cpp;
do_patch_extension double-conversion h h;