# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Tue Sep 18 19:46:58 CEST 2007 [mika]
+# Latest change: Sat Nov 03 12:01:12 CET 2007 [mika]
################################################################################
-set -u
set -e
-# FIXME: replace it with /etc/locale.gen.grml finally!
-cp $target/etc/locale.gen.minimal $target/etc/locale.gen
-$ROOTCMD locale-gen
+if [ -x $target/usr/sbin/localepurge ] ; then
+ $ROOTCMD dpkg-reconfigure localepurge
+fi
+
+# use full locales setup only in classes GRML_FULL and LOCALES
+if ifclass GRML_FULL || ifclass LOCALES ; then
+ echo 'Using /etc/locale.gen.grml for locales generation'
+ cp $target/etc/locale.gen.grml $target/etc/locale.gen
+else
+ echo 'Using /etc/locale.gen.minimal for locales generation'
+ cp $target/etc/locale.gen.minimal $target/etc/locale.gen
+fi
+
+if [ -x $target/usr/sbin/locale-gen ] ; then
+ $ROOTCMD locale-gen
+else
+ echo 'Warning: locale-gen [package locales] not available'
+fi
+
+if [ -x $target/usr/sbin/localepurge ] ; then
+ $ROOTCMD localepurge
+fi
## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3