From ecb125a69f73cb71197a1db5c870a1263060d496 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 5 Sep 2007 18:34:47 +0200 Subject: [PATCH] Update grml-setkeyboard and grml-setlang --- debian/changelog | 8 ++++++++ usr_sbin/grml-setkeyboard | 4 ++-- usr_sbin/grml-setlang | 17 ++++++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7533186..77d6707 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +grml-scripts (1.0.14) unstable; urgency=low + + * grml-setkeyboard: execute dialog using LANG=C + * grml-setlang: execute dialog using LANC=C and adjust modification + of /etc/default/locale according to what Debian ships now. + + -- Michael Prokop Wed, 5 Sep 2007 18:33:35 +0200 + grml-scripts (1.0.13) unstable; urgency=low * iso-term: support additional arguments on the commandline so they diff --git a/usr_sbin/grml-setkeyboard b/usr_sbin/grml-setkeyboard index f644e41..04464de 100755 --- a/usr_sbin/grml-setkeyboard +++ b/usr_sbin/grml-setkeyboard @@ -118,10 +118,10 @@ retval=$? case $retval in (0) # everything ok - $DIALOG --stdout --msgbox "Writing keyboard settings ($KEYTABLE) to /etc/sysconfig/keyboard was successful." 0 0 + LANG=C $DIALOG --stdout --msgbox "Writing keyboard settings ($KEYTABLE) to /etc/sysconfig/keyboard was successful." 0 0 ;; *) - $DIALOG --stdout --msgbox "Error writing settings for $KEYTABLE to /etc/sysconfig/keyboard." 0 0 + LANG=C $DIALOG --stdout --msgbox "Error writing settings for $KEYTABLE to /etc/sysconfig/keyboard." 0 0 ;; esac diff --git a/usr_sbin/grml-setlang b/usr_sbin/grml-setlang index df45be8..f8cb28b 100755 --- a/usr_sbin/grml-setlang +++ b/usr_sbin/grml-setlang @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Apr 28 17:38:28 CEST 2007 [mika] +# Latest change: Mit Sep 05 18:33:23 CEST 2007 [mika] ################################################################################ PN="$(basename $0)" @@ -40,8 +40,11 @@ fi setvalue(){ [ -n "$2" ] || return 1 # already present in conffile? - if grep -q ${1} $CONFFILE ; then - sed -i "s#^${1}.*#${1}${2}#" $CONFFILE + if grep -q "^${1}" "$CONFFILE" ; then + sed -i "s#^${1}.*#${1}${2}#" $CONFFILE + # is the new Debian style /etc/default/locale present? + elif grep -q "^# ${1}$" "$CONFFILE" ; then + sed -i "s#^\# ${1}#${1}${2}#" $CONFFILE else echo "$1${2}" >> $CONFFILE fi @@ -50,7 +53,7 @@ setvalue(){ # grml-small does not provide any further locales if grep -q small /etc/grml_version 2>/dev/null ; then if [ -z "$NONINTERACTIVE" ] ; then - $DIALOG --stdout --msgbox "Notice: grml-small does not provide a full language setup. + LANG=C $DIALOG --stdout --msgbox "Notice: grml-small does not provide a full language setup. You have to make sure the appropriate packages are installed." 0 0 exit 1 @@ -68,7 +71,7 @@ if [ -z "$DEFAULT_LANGUAGE" ] ; then fi if [ -z "$NONINTERACTIVE" ] ; then - LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \ + LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \ "Which language do you want to use? This will affect \$LANG, \$LANGUAGE and \$LC_MESSAGES. @@ -191,7 +194,7 @@ retval=$? case $retval in (0) if [ -z "$NONINTERACTIVE" ] ; then - $DIALOG --stdout --msgbox "Writing language settings ($LANGUAGE) to $CONFFILE was successful." 0 0 + LANG=C $DIALOG --stdout --msgbox "Writing language settings ($LANGUAGE) to $CONFFILE was successful." 0 0 else einfo "Writing language settings ($LANGUAGE) to $CONFFILE was successful." esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful." ; eend 0 @@ -199,7 +202,7 @@ case $retval in ;; *) if [ -z "$NONINTERACTIVE" ] ; then - $DIALOG --stdout --msgbox "Error writing settings for $LANGUAGE to $CONFFILE." 0 0 + LANG=C $DIALOG --stdout --msgbox "Error writing settings for $LANGUAGE to $CONFFILE." 0 0 else eerror "Error writing settings for $LANGUAGE to $CONFFILE." ; eend 1 esyslog user.notice "$PN" "Error writing settings for $LANGUAGE to $CONFFILE." -- 2.1.4