X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=ebdc8c462c0c550de85b77d50463072372ad1839;hb=a334e620ac26857d2e69f683d37110de3bf8bf59;hp=6413868a1e1f4d9ca2890468c67c4cc7cd992f85;hpb=2ca0dbd0c6c05c77ff6b438ac1183c609c36caa6;p=carnet-upgrade.git diff --git a/debian/postinst b/debian/postinst index 6413868..ebdc8c4 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,14 +3,52 @@ set -e [ "$1" = "configure" ] || exit 0 +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx + +# Load debconf +. /usr/share/debconf/confmodule +db_version 2.0 + +# Load CARNET Tools +. /usr/share/carnet-tools/functions.sh # clear old cached values if dpkg --compare-versions "$2" lt 6.0; then export CN_POSTINST=1 fi -# Load debconf -. /usr/share/debconf/confmodule -db_version 2.0 +# perl se buni ako nema postavljen defaultni locale +# stavit cemo en_US.UTF-8 + +if ! grep -q "^en_US.UTF-8 UTF-8" /etc/locale.gen; then + # generirat cemo najpotrebnije locale (HR, EN, te HR.UTF i EN.UTF8) + cp_check_and_sed '# en_US.UTF-8 UTF-8' \ + 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' \ + /etc/locale.gen || true + + cp_check_and_sed '# en_US ISO-8859-1' \ + 's/# en_US ISO-8859-1/en_US ISO-8859-1/g' \ + /etc/locale.gen || true + + cp_check_and_sed '# hr_HR ISO-8859-2' \ + 's/# hr_HR ISO-8859-2/hr_HR ISO-8859-2/g' \ + /etc/locale.gen || true + + cp_check_and_sed '# hr_HR.UTF-8 UTF-8' \ + 's/# hr_HR.UTF-8 UTF-8/hr_HR.UTF-8 UTF-8/g' \ + /etc/locale.gen || true + locale-gen +fi + +# Ako ima već neki default ne diramo ga +if [ -f /etc/default/locale ]; then + if [ ! $(grep -q "^LANG" /etc/default/locale) ]; then + cat > /etc/default/locale <