2 # Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/25-locales
3 # Purpose: locales (language) configuration of the live system
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
12 # set up /etc/locale.gen, only GRML_FULL and LOCALES have
13 # the full setup, GRMLBASE installs a minimal configuration
16 # get rid of locales unless using class LOCALES
18 if ! ifclass LOCALES ; then
20 echo 'Removing /usr/share/locale'
22 # get rid of the original
23 rm -rf $target/usr/share/locale
25 # restore *empty* directories because otherwise installation/upgrade of packages might fail
26 [ -d "$target"/usr/share/locale ] || mkdir "$target"/usr/share/locale
27 $ROOTCMD ln -s /etc/locale.alias /usr/share/locale/locale.alias
29 # make sure the directories of removed locales exist; ugly hack but no other solution present :(
30 echo 'Creating empty /usr/share/locale/*/LC_MESSAGES directories'
31 for f in $($ROOTCMD dpkg -S LC_MESSAGES | awk '{print $2}' | grep '/usr/share/locale/' | sed 's#LC_MESSAGES.*##' | sort -u) ; do
32 if ! [ -d "$target/$f"/LC_MESSAGES ] ; then
33 $ROOTCMD mkdir -p "$f"/LC_MESSAGES
39 # localepurge localepurge/nopurge multiselect ....
40 # is set so localepurge works as expected
41 if [ -x $target/usr/sbin/localepurge ] ; then
42 $ROOTCMD dpkg-reconfigure -f noninteractive localepurge
45 if ! [ -x $target/usr/sbin/locale-gen ] ; then
46 echo 'Warning: locale-gen [package locales] not installed'
48 echo "Running locale-gen"
52 if ! [ -x $target/usr/sbin/localepurge ] ; then
53 echo "Warning: localepurge not installed"
55 echo "Running localepurge."
59 ## END OF FILE #################################################################
60 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2