update_unicode.sh: move it into contrib/update-unicode
As it's used only by a tiny minority of the Git developer population, this script does not belong into the main Git source directory. Move it into contrib/ and adjust the paths to account for the new location. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Beat Bolli committed
Dec 14, 2016 at 00:31 UTC
f3eb54920eff356a30df144d50b45a5581e5eb13
4 files changed
+26
-6
.gitignore
-1
@@ -231,7 +231,6 @@
231
/config.mak.autogen
232
/config.mak.append
233
/configure
234
-/unicode
234
/tags
235
/TAGS
236
/cscope*
contrib/update-unicode/.gitignore
new
+3
@@ -0,0 +1,3 @@
1
+uniset/
2
+UnicodeData.txt
3
+EastAsianWidth.txt
contrib/update-unicode/README
new
+20
@@ -0,0 +1,20 @@
1
+TL;DR: Run update_unicode.sh after the publication of a new Unicode
2
+standard and commit the resulting unicode_widths.h file.
3
+
4
+The long version
5
+================
6
+
7
+The Git source code ships the file unicode_widths.h which contains
8
+tables of zero and double width Unicode code points, respectively.
9
+These tables are generated using update_unicode.sh in this directory.
10
+update_unicode.sh itself uses a third-party tool, uniset, to query two
11
+Unicode data files for the interesting code points.
12
+
13
+On first run, update_unicode.sh clones uniset from Github and builds it.
14
+This requires a current-ish version of autoconf (2.69 works per December
15
+2016).
16
+
17
+On each run, update_unicode.sh checks whether more recent Unicode data
18
+files are available from the Unicode consortium, and rebuilds the header
19
+unicode_widths.h with the new data. The new header can then be
20
+committed.
contrib/update-unicode/update_unicode.sh
renamed
+3
-5
@@ -5,11 +5,9 @@
5
#Mn Nonspacing_Mark a nonspacing combining mark (zero advance width)
6
#Cf Format a format control character
7
#
8
-UNICODEWIDTH_H=../unicode_width.h
9
-if ! test -d unicode; then
10
- mkdir unicode
11
-fi &&
12
-( cd unicode &&
8
+cd "$(dirname "$0")"
9
+UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
10
+(
11
if ! test -f UnicodeData.txt; then
12
wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
13
fi &&