X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F25-locales;h=58ed8c75293d25fa2187c2d6686ac0d34f31f09d;hp=ccc402874500e2e8d3fad0c00690ae2418b58820;hb=f3b335ea5c94d5cf24ec6b9184106b298849f311;hpb=9d16d7a6c9686f80a18e70bc8b5e67193dc0ffba diff --git a/etc/grml/fai/config/scripts/GRMLBASE/25-locales b/etc/grml/fai/config/scripts/GRMLBASE/25-locales index ccc4028..58ed8c7 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/25-locales +++ b/etc/grml/fai/config/scripts/GRMLBASE/25-locales @@ -1,36 +1,26 @@ #!/bin/bash -# Filename: /etc/grml/fai/config/scripts/GRMLBASE/25-locales +# Filename: ${GRML_FAI_CONFIG}/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. ################################################################################ +set -u set -e -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 +# set up /etc/locale.gen, only GRML_FULL and LOCALES have +# the full setup, GRMLBASE installs a minimal configuration +fcopy /etc/locale.gen # get rid of locales unless using class LOCALES -# TODO -# * this should be improved in the long run, ideas welcome :) -# * what about /usr/share/i18n/locales? +set +u if ! ifclass LOCALES ; then +set -u echo 'Removing /usr/share/locale' # get rid of the original - $ROOTCMD rm -rf /usr/share/locale + rm -rf $target/usr/share/locale # restore *empty* directories because otherwise installation/upgrade of packages might fail [ -d "$target"/usr/share/locale ] || mkdir "$target"/usr/share/locale @@ -52,15 +42,19 @@ 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 +if ! [ -x $target/usr/sbin/locale-gen ] ; then + echo 'Warning: locale-gen [package locales] not installed' else - echo 'Warning: locale-gen [package locales] not available' + echo "Running locale-gen" + $ROOTCMD locale-gen fi -if [ -x $target/usr/sbin/localepurge ] ; then - $ROOTCMD localepurge +if ! [ -x $target/usr/sbin/localepurge ] ; then + echo "Warning: localepurge not installed" +else + echo "Running localepurge." + $ROOTCMD localepurge fi ## END OF FILE ################################################################# -# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 +# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2