diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:06:20 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 19:06:58 +0000 |
commit | 3fcbb67b7949a8b362de5558bf1c6dd7ec5d21cf (patch) | |
tree | b867f9a6d3426f212b2f073bef8067a830f13022 /localedata/gen-locale.sh | |
parent | b6df7ac2cbe11e6a72f2ab7bd35c6130b72d21d9 (diff) | |
parent | cab56836b146bc129f1ad43f0393d95a9deca63a (diff) |
Merge commit 'refs/top-bases/t/tls-threadvar' into t/tls-threadvar
Diffstat (limited to 'localedata/gen-locale.sh')
-rw-r--r-- | localedata/gen-locale.sh | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/localedata/gen-locale.sh b/localedata/gen-locale.sh index d471086d0d..b91e42af13 100644 --- a/localedata/gen-locale.sh +++ b/localedata/gen-locale.sh @@ -1,6 +1,6 @@ #!/bin/sh # Generate test locale files. -# Copyright (C) 2000-2016 Free Software Foundation, Inc. +# Copyright (C) 2000-2018 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -30,10 +30,12 @@ generate_locale () charmap=$1 input=$2 out=$3 - if ${localedef_before_env} ${run_program_env} I18NPATH=../localedata \ - ${localedef_after_env} --quiet -c -f $charmap -i $input \ - ${common_objpfx}localedata/$out - then + flags=$4 + ret=0 + ${localedef_before_env} ${run_program_env} I18NPATH=../localedata \ + ${localedef_after_env} $flags -f $charmap -i $input \ + ${common_objpfx}localedata/$out || ret=$? + if [ $ret -eq 0 ]; then # The makefile checks the timestamp of the LC_CTYPE file, # but localedef won't have touched it if it was able to # hard-link it to an existing file. @@ -47,8 +49,29 @@ generate_locale () locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'` locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'` -charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'` +charmap=`echo $locfile|sed 's|[^.]*[.]\([^@ ]*\)\(@[^ ]*\)\?/LC_CTYPE|\1|'` +modifier=`echo $locfile|sed 's|[^.]*[.]\([^@ ]*\)\(@[^ ]*\)\?/LC_CTYPE|\2|'` echo "Generating locale $locale.$charmap: this might take a while..." -generate_locale `echo $charmap | sed -e s/SJIS/SHIFT_JIS/` $locale \ - $locale.$charmap + +# Run quietly and force output. +flags="--quiet -c" + +# For SJIS the charmap is SHIFT_JIS. We just want the locale to have +# a slightly nicer name instead of using "*.SHIFT_SJIS", but that +# means we need a mapping here. +charmap_real="$charmap" +if [ "$charmap" = "SJIS" ]; then + charmap_real="SHIFT_JIS" +fi + +# In addition to this the SHIFT_JIS character maps are not ASCII +# compatible so we must use `--no-warnings=ascii' to disable the +# warning. See localedata/Makefile $(INSTALL-SUPPORTED-LOCALES) +# for the same logic. +if [ "$charmap_real" = 'SHIFT_JIS' ] \ + || [ "$charmap_real" = 'SHIFT_JISX0213' ]; then + flags="$flags --no-warnings=ascii" +fi + +generate_locale $charmap_real $locale$modifier $locale.$charmap$modifier "$flags" |