michael@0: #!/bin/sh michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: set -e michael@0: michael@0: # Usage: update-icu.sh michael@0: # E.g., for ICU 52.1: update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/ michael@0: michael@0: if [ $# -lt 1 ]; then michael@0: echo "Usage: update-icu.sh " michael@0: exit 1 michael@0: fi michael@0: michael@0: # Ensure that $Date$ in the checked-out svn files expands timezone-agnostically, michael@0: # so that this script's behavior is consistent when run from any time zone. michael@0: export TZ=UTC michael@0: michael@0: icu_dir=`dirname $0`/icu michael@0: michael@0: # Remove intl/icu/source, then replace it with a clean export. michael@0: rm -rf ${icu_dir}/source michael@0: svn export $1/source/ ${icu_dir}/source michael@0: michael@0: # remove layout, tests, and samples, but leave makefiles in place michael@0: find ${icu_dir}/source/layout -name '*Makefile.in' -prune -or -type f -print | xargs rm michael@0: find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm michael@0: find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm michael@0: find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm michael@0: michael@0: # remove data that we currently don't need michael@0: rm ${icu_dir}/source/data/brkitr/* michael@0: rm ${icu_dir}/source/data/lang/*.mk michael@0: rm ${icu_dir}/source/data/lang/*.txt michael@0: rm ${icu_dir}/source/data/mappings/*.mk michael@0: find ${icu_dir}/source/data/mappings \ michael@0: -name ibm-37_P100-1995.ucm -prune -or \ michael@0: -name ibm-1047_P100-1995.ucm -prune -or \ michael@0: -name '*.ucm' -print | xargs rm michael@0: rm ${icu_dir}/source/data/rbnf/* michael@0: rm ${icu_dir}/source/data/region/*.mk michael@0: rm ${icu_dir}/source/data/region/*.txt michael@0: rm ${icu_dir}/source/data/translit/* michael@0: michael@0: # Record `svn info`, eliding the line that changes every time the entire ICU michael@0: # repository (not just the path within it we care about) receives a commit. michael@0: # (This ensures that if ICU modifications are performed properly, it's always michael@0: # possible to run the command at the top of this script and make no changes to michael@0: # the tree.) michael@0: svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO michael@0: michael@0: patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-724533 michael@0: patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-899722-4 michael@0: patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-915735 michael@0: patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/genrb-omitCollationRules.diff michael@0: patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/qualify-uinitonce-windows.diff michael@0: michael@0: hg addremove ${icu_dir}