X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F25-locales;h=c6c43906cc04df7ad1fe2a451f14e0902c19e007;hb=ed479669bb2a2c5fb0974718aaaf7bcc1d3c1320;hp=477a182ab89d65d144d5196c86f0fac0ab731d42;hpb=e08881cde5d29236a5992a0a501b43e88d66732d;p=grml-live.git diff --git a/etc/grml/fai/config/scripts/GRMLBASE/25-locales b/etc/grml/fai/config/scripts/GRMLBASE/25-locales index 477a182..c6c4390 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/25-locales +++ b/etc/grml/fai/config/scripts/GRMLBASE/25-locales @@ -1,17 +1,51 @@ #!/bin/sh -# Filename: /etc/grml/fai/config/scripts/GRML/25-locales +# Filename: /etc/grml/fai/config/scripts/GRMLBASE/25-locales # Purpose: locales (language) configuration of the live system # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Sun Sep 16 22:59:23 CEST 2007 [mika] ################################################################################ -set -u set -e -cp $target/etc/locale.gen.minimal $target/etc/locale.gen -$ROOTCMD locale-gen +if [ -z "$ROOTCMD" ] ; then + echo "variable \$ROOTCMD not set, exiting to avoid any possible damage">&2 + exit 1 +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 + +# 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 + +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 + +# get rid of LC_MESSAGES unless using class LOCALES +if ! ifclass LOCALES ; then + echo 'Removing /usr/share/locale' + $ROOTCMD rm -rf /usr/share/locale + $ROOTCMD mkdir /usr/share/locale + # TODO: /usr/share/i18n/locales +fi ## END OF FILE ################################################################# # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3