Bug 1452643 [wpt PR 10327] - [css-multicol] column-gap normal is 1em per spec now...
[gecko.git] / intl / update-icu.sh
blob6250998c57790933313e34e54fdc87c646a4add9
1 #!/bin/sh
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 set -e
8 # Usage: update-icu.sh <URL of ICU SVN with release>
9 # E.g., for ICU 58.2: update-icu.sh https://ssl.icu-project.org/repos/icu/tags/release-58-2/icu4c/
11 if [ $# -lt 1 ]; then
12 echo "Usage: update-icu.sh <URL of ICU SVN with release>"
13 exit 1
16 # Ensure that $Date$ in the checked-out svn files expands timezone-agnostically,
17 # so that this script's behavior is consistent when run from any time zone.
18 export TZ=UTC
20 # Also ensure SVN-INFO is consistently English.
21 export LANG=en_US.UTF-8
22 export LANGUAGE=en_US
23 export LC_ALL=en_US.UTF-8
25 icu_dir=`dirname $0`/icu
27 # Remove intl/icu/source, then replace it with a clean export.
28 rm -rf ${icu_dir}/source
29 svn export $1/source/ ${icu_dir}/source
31 # remove layoutex, tests, and samples, but leave makefiles in place
32 find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm
33 find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm
34 find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm
36 # remove data that we currently don't need
37 rm -rf ${icu_dir}/source/data/brkitr/*
38 rm ${icu_dir}/source/data/lang/*.mk
39 rm ${icu_dir}/source/data/lang/*.txt
40 rm ${icu_dir}/source/data/mappings/*.mk
41 find ${icu_dir}/source/data/mappings \
42 -name ibm-37_P100-1995.ucm -prune -or \
43 -name ibm-1047_P100-1995.ucm -prune -or \
44 -name '*.ucm' -print | xargs rm
45 rm ${icu_dir}/source/data/rbnf/*
46 rm ${icu_dir}/source/data/region/*.mk
47 rm ${icu_dir}/source/data/region/*.txt
48 rm ${icu_dir}/source/data/translit/*
49 rm ${icu_dir}/source/data/unit/*.mk
50 rm ${icu_dir}/source/data/unit/*.txt
51 # bug 1225401 and bug1345336 to remove unused zone name
52 find ${icu_dir}/source/data/zone \
53 -name root.txt -prune -or \
54 -name tzdbNames.txt -prune -or \
55 -name '*.txt' -print | xargs sed -i '/^\s\{8\}\"[A-Z]/, /^\s\{8\}}/ { d }'
56 find ${icu_dir}/source/data/zone \
57 -name root.txt -prune -or \
58 -name tzdbNames.txt -prune -or \
59 -name '*.txt' -print | xargs sed -i '/^\s\{4\}zoneStrings{/{N; s/^\s\{4\}zoneStrings{\n\s\{4\}}// }; /^$/d'
61 # Record `svn info`, eliding the line that changes every time the entire ICU
62 # repository (not just the path within it we care about) receives a commit.
63 # (This ensures that if ICU modifications are performed properly, it's always
64 # possible to run the command at the top of this script and make no changes to
65 # the tree.)
66 svn info $1 | grep -v '^Revision: [[:digit:]]\+$' > ${icu_dir}/SVN-INFO
68 for patch in \
69 bug-915735 \
70 suppress-warnings.diff \
71 bug-1172609-timezone-recreateDefault.diff \
72 bug-1198952-workaround-make-3.82-bug.diff \
73 ; do
74 echo "Applying local patch $patch"
75 patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch
76 done
78 topsrcdir=`dirname $0`/../
79 python ${topsrcdir}/js/src/tests/non262/String/make-normalize-generateddata-input.py $topsrcdir
81 # Update our moz.build files in config/external/icu, and
82 # build a new ICU data file.
83 python `dirname $0`/icu_sources_data.py $topsrcdir
85 hg addremove "${icu_dir}/source" "${icu_dir}/SVN-INFO" ${topsrcdir}/config/external/icu
87 # Check local tzdata version.
88 `dirname $0`/update-tzdata.sh -c