diff options
author | Britney Fransen <brfransen@gmail.com> | 2016-02-23 17:52:46 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2016-02-23 17:52:46 (GMT) |
commit | bc743255651a52f7767da3a5a00a370a7a8633f6 (patch) | |
tree | 059aa8d0688a485283009309bc43bdf8bd2753c3 /abs/core/glibc/locale-gen | |
parent | d96638f6d57163d0fb102d8449c1caf22aa7c0d9 (diff) | |
download | linhes_pkgbuild-bc743255651a52f7767da3a5a00a370a7a8633f6.zip linhes_pkgbuild-bc743255651a52f7767da3a5a00a370a7a8633f6.tar.gz linhes_pkgbuild-bc743255651a52f7767da3a5a00a370a7a8633f6.tar.bz2 |
glibc: update to 2.23
Diffstat (limited to 'abs/core/glibc/locale-gen')
-rwxr-xr-x | abs/core/glibc/locale-gen | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/abs/core/glibc/locale-gen b/abs/core/glibc/locale-gen new file mode 100755 index 0000000..5aff344 --- /dev/null +++ b/abs/core/glibc/locale-gen @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +LOCALEGEN=/etc/locale.gen +LOCALES=/usr/share/i18n/locales +if [ -n "$POSIXLY_CORRECT" ]; then + unset POSIXLY_CORRECT +fi + + +[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0; + +# Remove all old locale dir and locale-archive before generating new +# locale data. +rm -rf /usr/lib/locale/* || true + +umask 022 + +is_entry_ok() { + if [ -n "$locale" -a -n "$charset" ] ; then + true + else + echo "error: Bad entry '$locale $charset'" + false + fi +} + +echo "Generating locales..." +while read locale charset; do \ + case $locale in \#*) continue;; "") continue;; esac; \ + is_entry_ok || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ + echo -n ".$charset"; \ + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ + echo -n '...'; \ + if [ -f $LOCALES/$locale ]; then input=$locale; else \ + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \ + localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \ + echo ' done'; \ +done < $LOCALEGEN +echo "Generation complete." |