1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/update-icu.sh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +#!/bin/sh 1.5 +# This Source Code Form is subject to the terms of the Mozilla Public 1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + 1.9 +set -e 1.10 + 1.11 +# Usage: update-icu.sh <URL of ICU SVN with release> 1.12 +# E.g., for ICU 52.1: update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/ 1.13 + 1.14 +if [ $# -lt 1 ]; then 1.15 + echo "Usage: update-icu.sh <URL of ICU SVN with release>" 1.16 + exit 1 1.17 +fi 1.18 + 1.19 +# Ensure that $Date$ in the checked-out svn files expands timezone-agnostically, 1.20 +# so that this script's behavior is consistent when run from any time zone. 1.21 +export TZ=UTC 1.22 + 1.23 +icu_dir=`dirname $0`/icu 1.24 + 1.25 +# Remove intl/icu/source, then replace it with a clean export. 1.26 +rm -rf ${icu_dir}/source 1.27 +svn export $1/source/ ${icu_dir}/source 1.28 + 1.29 +# remove layout, tests, and samples, but leave makefiles in place 1.30 +find ${icu_dir}/source/layout -name '*Makefile.in' -prune -or -type f -print | xargs rm 1.31 +find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm 1.32 +find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm 1.33 +find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm 1.34 + 1.35 +# remove data that we currently don't need 1.36 +rm ${icu_dir}/source/data/brkitr/* 1.37 +rm ${icu_dir}/source/data/lang/*.mk 1.38 +rm ${icu_dir}/source/data/lang/*.txt 1.39 +rm ${icu_dir}/source/data/mappings/*.mk 1.40 +find ${icu_dir}/source/data/mappings \ 1.41 + -name ibm-37_P100-1995.ucm -prune -or \ 1.42 + -name ibm-1047_P100-1995.ucm -prune -or \ 1.43 + -name '*.ucm' -print | xargs rm 1.44 +rm ${icu_dir}/source/data/rbnf/* 1.45 +rm ${icu_dir}/source/data/region/*.mk 1.46 +rm ${icu_dir}/source/data/region/*.txt 1.47 +rm ${icu_dir}/source/data/translit/* 1.48 + 1.49 +# Record `svn info`, eliding the line that changes every time the entire ICU 1.50 +# repository (not just the path within it we care about) receives a commit. 1.51 +# (This ensures that if ICU modifications are performed properly, it's always 1.52 +# possible to run the command at the top of this script and make no changes to 1.53 +# the tree.) 1.54 +svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO 1.55 + 1.56 +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-724533 1.57 +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-899722-4 1.58 +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-915735 1.59 +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/genrb-omitCollationRules.diff 1.60 +patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/qualify-uinitonce-windows.diff 1.61 + 1.62 +hg addremove ${icu_dir}