X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=28684ddb9a7a670a947196a6257f10bddeda14c3;hp=cf99596273b53a32f33b3d59fcacdcd9f3b1e648;hb=2ef61aac8e83be7d8a53cf6914ce3c29004c2143;hpb=e45e376b45ef53014bd6f56164be2b5cbc9f49a1 diff --git a/chroot-script b/chroot-script index cf99596..28684dd 100755 --- a/chroot-script +++ b/chroot-script @@ -428,6 +428,20 @@ EOF } # }}} +# set default locales {{{ +default_locales() { + if [ -n "$DEFAULT_LOCALES" ] ; then + if ! [ -x /usr/sbin/update-locale ] ; then + echo "Warning: update-locale executable not available (no locales package installed?)" + echo "Ignoring request to run update-locale for $DEFAULT_LOCALES therefore" + return 0 + fi + + /usr/sbin/update-locale LANG="$DEFAULT_LOCALES" + fi +} +# }}} + # adjust timezone {{{ timezone() { if [ -n "$TIMEZONE" ] ; then @@ -608,7 +622,7 @@ trap signal_handler HUP INT QUIT TERM for i in chrootmirror grmlrepos backportrepos kernelimg_conf \ kernel packages extrapackages reconfigure hosts interfaces \ - timezone fstab hostname initrd grub_install passwords \ + default_locales timezone fstab hostname initrd grub_install passwords \ custom_scripts upgrade_system remove_apt_cache services \ remove_chrootmirror; do if stage $i ; then