Execute dpkg-reconfigure for localepurge with noninteractive frontend
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 25-locales
index 58f080d..b47a5e5 100755 (executable)
@@ -4,12 +4,17 @@
 # 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: Mon Oct 15 19:00:15 CEST 2007 [mika]
 ################################################################################
 
-set -u
 set -e
 
+# make sure:
+# localepurge     localepurge/nopurge     multiselect ....
+# is set so localepurge works as expected
+if [ -x $target/usr/sbin/localepurge ] ; then
+   $ROOTCMD dpkg-reconfigure -f noninteractive 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'
@@ -19,7 +24,15 @@ else
    cp $target/etc/locale.gen.minimal $target/etc/locale.gen
 fi
 
-$ROOTCMD locale-gen
+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