From 5c9cb61bd99bcc06acd6d775ce2ab28175f9fe09 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Mon, 1 Jun 2009 16:34:37 +0200 Subject: [PATCH] Izbacen 'dpkg-reconfigure -f noninteractive locales'. dpkg-reconfigure je stvarao problem sa debconf. --- debian/postinst | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/debian/postinst b/debian/postinst index f64830a..1f77371 100644 --- a/debian/postinst +++ b/debian/postinst @@ -31,7 +31,7 @@ FQDN=`hostname --fqdn` . /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.*-*-*.*:*:*" @@ -63,6 +63,20 @@ listconffiles () { 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` @@ -209,18 +223,20 @@ grep -q '\.' /etc/hostname || nodots=1 [ -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 -- 1.7.10.4