From dca18788d342633a8cf9a587234491d31e2bb6ba Mon Sep 17 00:00:00 2001 From: vorlon Date: Sun, 8 Sep 2002 03:05:18 +0000 Subject: bugfixes for charset handling git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk@335 fc4039ab-9d04-0410-8cac-899223bdd6b0 --- samba-common.postinst | 38 +++++++++++++++++++++++--------------- samba-common.templates | 2 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/samba-common.postinst b/samba-common.postinst index 4e0a56f703..1cadec77e7 100644 --- a/samba-common.postinst +++ b/samba-common.postinst @@ -39,23 +39,31 @@ if [ "${RET}" = "true" ]; then mv -f ${TMPFILE} /etc/samba/smb.conf # Update charset settings? - db_get samba-common/character_set || true - DISPLAYCHARSET="${RET}" - if [ -n "$DISPLAYCHARSET" ]; then - TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX` - sed -e "/^[[:space:]]*character set[[:space:]]*=/c \ - display character set = $DISPLAYCHARSET\ - unix character set = $DISPLAYCHARSET" < /etc/samba/smb.conf > ${TMPFILE} - mv -f ${TMPFILE} /etc/samba/smb.conf + if ! grep -q "^[[:space:]]*unix charset[[:space:]]*=" /etc/samba/smb.conf + then + db_get samba-common/character_set || true + DISPLAYCHARSET="${RET}" + if [ -n "$DISPLAYCHARSET" ] + then + TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX` + sed -e "/^[[:space:]]*character set[[:space:]]*=/c \\ + display charset = $DISPLAYCHARSET\\ + unix charset = $DISPLAYCHARSET" < /etc/samba/smb.conf > ${TMPFILE} + mv -f ${TMPFILE} /etc/samba/smb.conf + fi fi - db_get samba-common/codepage || true - DOSCHARSET="${RET}" - if [ -n "$DOSCHARSET" ]; then - TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX` - sed -e "/^[[:space:]]*client code page[[:space:]]*=/c \ - dos character set = $DOSCHARSET" < /etc/samba/smb.conf > ${TMPFILE} - mv -f ${TMPFILE} /etc/samba/smb.conf + if ! grep -q "^[[:space:]]*dos charset[[:space:]]*=" /etc/samba/smb.conf + then + db_get samba-common/codepage || true + DOSCHARSET="${RET}" + if [ -n "$DOSCHARSET" ] + then + TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX` + sed -e "/^[[:space:]]*client code page[[:space:]]*=/c \\ + dos charset = $DOSCHARSET" < /etc/samba/smb.conf > ${TMPFILE} + mv -f ${TMPFILE} /etc/samba/smb.conf + fi fi fi diff --git a/samba-common.templates b/samba-common.templates index 3bf8a43122..c78692a410 100644 --- a/samba-common.templates +++ b/samba-common.templates @@ -1,4 +1,4 @@ -Template: samba-common/charset +Template: samba-common/character_set Type: string Description: Character Set for Unix filesystem You currently have a "character set" configured in your smb.conf. In -- cgit v1.2.3