update_unicode.sh: pin the uniset repo to a known good commit
[git.git] / contrib / update-unicode / update_unicode.sh
blob9f1bf31ff522ed3fc72abef169c131edda4de8e4
1 #!/bin/sh
2 #See http://www.unicode.org/reports/tr44/
4 #Me Enclosing_Mark an enclosing combining mark
5 #Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
6 #Cf Format a format control character
8 cd "$(dirname "$0")"
9 UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
11 if ! test -f UnicodeData.txt; then
12 wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
13 fi &&
14 if ! test -f EastAsianWidth.txt; then
15 wget http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
16 fi &&
17 if ! test -d uniset; then
18 git clone https://github.com/depp/uniset.git &&
19 ( cd uniset && git checkout 4b186196dd )
20 fi &&
22 cd uniset &&
23 if ! test -x uniset; then
24 autoreconf -i &&
25 ./configure --enable-warnings=-Werror CFLAGS='-O0 -ggdb'
26 fi &&
27 make
28 ) &&
29 UNICODE_DIR=. && export UNICODE_DIR &&
30 cat >$UNICODEWIDTH_H <<-EOF
31 static const struct interval zero_width[] = {
32 $(uniset/uniset --32 cat:Me,Mn,Cf + U+1160..U+11FF - U+00AD |
33 grep -v plane)
35 static const struct interval double_width[] = {
36 $(uniset/uniset --32 eaw:F,W)
38 EOF