update_unicode.sh: automatically download newer definition files
authorBeat Bolli <dev+git@drbeat.li>
Tue, 13 Dec 2016 23:31:42 +0000 (00:31 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Dec 2016 17:48:00 +0000 (09:48 -0800)
Checking just for the unicode data files' existence is not sufficient;
we should also download them if a newer version exists on the Unicode
consortium's servers. Option -N of wget does this nicely for us.

Reviewed-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/update-unicode/update_unicode.sh
index 9f1bf31ff522ed3fc72abef169c131edda4de8e4..56871a1f499d4f63903fa72c54080982d0139e1c 100755 (executable)
@@ -8,12 +8,8 @@
 cd "$(dirname "$0")"
 UNICODEWIDTH_H=$(git rev-parse --show-toplevel)/unicode_width.h
 
-if ! test -f UnicodeData.txt; then
-       wget http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
-fi &&
-if ! test -f EastAsianWidth.txt; then
-       wget http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
-fi &&
+wget -N http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt \
+       http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt &&
 if ! test -d uniset; then
        git clone https://github.com/depp/uniset.git &&
        ( cd uniset && git checkout 4b186196dd )