Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | #!/bin/sh |
michael@0 | 2 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | |
michael@0 | 6 | set -e |
michael@0 | 7 | |
michael@0 | 8 | # Usage: update-icu.sh <URL of ICU SVN with release> |
michael@0 | 9 | # E.g., for ICU 52.1: update-icu.sh http://source.icu-project.org/repos/icu/icu/tags/release-52-1/ |
michael@0 | 10 | |
michael@0 | 11 | if [ $# -lt 1 ]; then |
michael@0 | 12 | echo "Usage: update-icu.sh <URL of ICU SVN with release>" |
michael@0 | 13 | exit 1 |
michael@0 | 14 | fi |
michael@0 | 15 | |
michael@0 | 16 | # Ensure that $Date$ in the checked-out svn files expands timezone-agnostically, |
michael@0 | 17 | # so that this script's behavior is consistent when run from any time zone. |
michael@0 | 18 | export TZ=UTC |
michael@0 | 19 | |
michael@0 | 20 | icu_dir=`dirname $0`/icu |
michael@0 | 21 | |
michael@0 | 22 | # Remove intl/icu/source, then replace it with a clean export. |
michael@0 | 23 | rm -rf ${icu_dir}/source |
michael@0 | 24 | svn export $1/source/ ${icu_dir}/source |
michael@0 | 25 | |
michael@0 | 26 | # remove layout, tests, and samples, but leave makefiles in place |
michael@0 | 27 | find ${icu_dir}/source/layout -name '*Makefile.in' -prune -or -type f -print | xargs rm |
michael@0 | 28 | find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm |
michael@0 | 29 | find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm |
michael@0 | 30 | find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm |
michael@0 | 31 | |
michael@0 | 32 | # remove data that we currently don't need |
michael@0 | 33 | rm ${icu_dir}/source/data/brkitr/* |
michael@0 | 34 | rm ${icu_dir}/source/data/lang/*.mk |
michael@0 | 35 | rm ${icu_dir}/source/data/lang/*.txt |
michael@0 | 36 | rm ${icu_dir}/source/data/mappings/*.mk |
michael@0 | 37 | find ${icu_dir}/source/data/mappings \ |
michael@0 | 38 | -name ibm-37_P100-1995.ucm -prune -or \ |
michael@0 | 39 | -name ibm-1047_P100-1995.ucm -prune -or \ |
michael@0 | 40 | -name '*.ucm' -print | xargs rm |
michael@0 | 41 | rm ${icu_dir}/source/data/rbnf/* |
michael@0 | 42 | rm ${icu_dir}/source/data/region/*.mk |
michael@0 | 43 | rm ${icu_dir}/source/data/region/*.txt |
michael@0 | 44 | rm ${icu_dir}/source/data/translit/* |
michael@0 | 45 | |
michael@0 | 46 | # Record `svn info`, eliding the line that changes every time the entire ICU |
michael@0 | 47 | # repository (not just the path within it we care about) receives a commit. |
michael@0 | 48 | # (This ensures that if ICU modifications are performed properly, it's always |
michael@0 | 49 | # possible to run the command at the top of this script and make no changes to |
michael@0 | 50 | # the tree.) |
michael@0 | 51 | svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO |
michael@0 | 52 | |
michael@0 | 53 | patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-724533 |
michael@0 | 54 | patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-899722-4 |
michael@0 | 55 | patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/bug-915735 |
michael@0 | 56 | patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/genrb-omitCollationRules.diff |
michael@0 | 57 | patch -d ${icu_dir}/../../ -p1 < ${icu_dir}/../icu-patches/qualify-uinitonce-windows.diff |
michael@0 | 58 | |
michael@0 | 59 | hg addremove ${icu_dir} |