. /usr/share/carnet-tools/functions.sh
unset CP_ECHO_RETURN
-mv_old_backups() {
+mv_old_backups () {
# Clean up /etc, nove old jun^H^H^Hbackups where they belong
glob="$1.old.*-*-*.*:*:*"
fi
}
+# genlocales ()
+#
+# Update/generate localisation files from templates if locales-all
+# is not installed.
+#
+genlocales () {
+
+ if [ -f /usr/lib/locales-all/supported.tar.lzma ] ; then
+ cp_echo "CN: locales-all installed, skipping locales generation."
+ else
+ /usr/sbin/locale-gen
+ fi
+}
+
need_restart=0
DATE=`date +%Y-%m-%d.%H:%M:%S`
[ -e /etc/mailname ] || nomailname=1
-# Generate hr_HR locale if needed.
+# Check for hr_HR locale.
#
-if ! egrep -q '^hr_HR ISO-8859-2\b' /etc/locale.gen; then
- if [ -f /etc/locale.gen ]; then
- echo "hr_HR ISO-8859-2" >> /etc/locale.gen
- cp_echo "CN: Added hr_HR locale to /etc/locale.gen."
- else
- echo "hr_HR ISO-8859-2" > /etc/locale.gen
- cp_echo "CN: /etc/locale.gen created."
- fi
- dpkg-reconfigure -f noninteractive locales
- need_restart=1
+if [ -f /etc/locale.gen ]; then
+ if ! egrep -q '^hr_HR ISO-8859-2\b' /etc/locale.gen; then
+ echo "hr_HR ISO-8859-2" >> /etc/locale.gen
+ cp_echo "CN: Added hr_HR locale to /etc/locale.gen."
+ genlocales
+ need_restart=1
+ fi
+else
+ echo "hr_HR ISO-8859-2" > /etc/locale.gen
+ cp_echo "CN: /etc/locale.gen created."
+ genlocales
+ need_restart=1
fi