summaryrefslogtreecommitdiff
path: root/libre/xtensa-unknown-elf-glibc/locale-gen
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@lavabit.com>2013-07-03 20:26:13 -0300
committerAndré Fabian Silva Delgado <emulatorman@lavabit.com>2013-07-03 20:26:13 -0300
commitc4dfd2dd26c974e2c0757c3a1ad71b2fc4d72c86 (patch)
tree3b2b224247d684045bcaca547b10eee20599ee94 /libre/xtensa-unknown-elf-glibc/locale-gen
parentaddf0caba72d862bf5b9f7f02cb2c1663c6ae7c5 (diff)
parentfd0908ce8b8a8956442327e7c7e2b2433ec84efb (diff)
Merge branch 'master' of ssh://projects.parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre/xtensa-unknown-elf-glibc/locale-gen')
-rw-r--r--libre/xtensa-unknown-elf-glibc/locale-gen42
1 files changed, 42 insertions, 0 deletions
diff --git a/libre/xtensa-unknown-elf-glibc/locale-gen b/libre/xtensa-unknown-elf-glibc/locale-gen
new file mode 100644
index 000000000..5aff344c4
--- /dev/null
+++ b/libre/xtensa-unknown-elf-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."