diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2012-06-02 01:52:51 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2012-06-02 01:52:51 +0000 |
commit | 61a4e6a433a25f571a5fa9a20ff3f9278f4c1e56 (patch) | |
tree | 33be34f6535dc7f606075392d5fe9118f95232df /libc/debian/locale-gen | |
parent | c613cdb8f8ab3b9ad565c742cfcef315676d596e (diff) | |
download | illumos-packaging-61a4e6a433a25f571a5fa9a20ff3f9278f4c1e56.tar.gz |
Added maintainer scripts for locales
Diffstat (limited to 'libc/debian/locale-gen')
-rwxr-xr-x | libc/debian/locale-gen | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/libc/debian/locale-gen b/libc/debian/locale-gen index 3d13dad..5fab9b8 100755 --- a/libc/debian/locale-gen +++ b/libc/debian/locale-gen @@ -4,7 +4,6 @@ set -e LOCALEGEN=/etc/locale.gen LOCALES=/usr/share/i18n/locales -USER_LOCALES=/usr/local/share/i18n/locales if [ -n "$POSIXLY_CORRECT" ]; then unset POSIXLY_CORRECT fi @@ -13,17 +12,6 @@ fi [ -f $LOCALEGEN ] || exit 0; [ -s $LOCALEGEN ] || exit 0; -KEEP= -if [ "$1" = '--keep-existing' ]; then - KEEP=1 -fi - -if [ -z "$KEEP" ]; then - # Remove all old locale dir and locale-archive before generating new - # locale data. - rm -rf /usr/lib/locale/locale-archive || true -fi - umask 022 is_entry_ok() { @@ -36,28 +24,25 @@ is_entry_ok() { } echo "Generating locales (this might take a while)..." -while read locale charset; do \ - case $locale in \#*) continue;; "") continue;; esac; \ +rm -rf /usr/lib/locale/* 2>/dev/null +while read locale charset; do + case $locale in + \#*) continue;; + "") continue;; + esac + is_entry_ok || continue + if [ "$KEEP" ] && PERL_BADLANG=0 perl -MPOSIX -e \ 'exit 1 unless setlocale(LC_ALL, $ARGV[0])' "$locale"; then continue fi - echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \ - echo -n ".$charset"; \ - echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \ - echo -n '...'; \ - if [ -f $USER_LOCALES/$locale ] ; then - input=$USER_LOCALES/$locale - elif [ -f $LOCALES/$locale ]; then - input=$locale - else - input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'` - if [ -f $USER_LOCALES/$input ]; then - input=$USER_LOCALES/$input - fi - fi - localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale || :; \ - echo ' done'; \ + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`" + echo -n ".$charset" + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'` + echo -n '...' + localedef -i $LOCALES/$locale.src -f $LOCALES/$charset.cm \ + /usr/lib/locale/$locale || : + echo ' done' done < $LOCALEGEN echo "Generation complete." |