5 LOCALEGEN
=/etc
/locale.gen
6 LOCALES
=/usr
/share
/i18n
/locales
7 if [ -n "$POSIXLY_CORRECT" ]; then
12 [ -f $LOCALEGEN -a -s $LOCALEGEN ] ||
exit 0;
14 # Remove all old locale dir and locale-archive before generating new
16 rm -rf /usr
/lib
/locale
/locale-archive || true
21 if [ -n "$locale" -a -n "$charset" ] ; then
24 echo "error: Bad entry '$locale $charset'"
29 echo "Generating locales..."
30 while read locale charset
; do \
31 case $locale in \
#*) continue;; "") continue;; esac; \
32 is_entry_ok ||
continue
33 echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
34 echo -n ".$charset"; \
35 echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
37 if [ -f $LOCALES/$locale ]; then input
=$locale; else \
38 input
=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
39 localedef
-i $input -c -f $charset -A /usr
/share
/locale
/locale.
alias $locale; \
42 echo "Generation complete."