Package: kbd
Version: 1.14.1-4
Severity: normal
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch jaunty
kbd/debian/console-screen.kbd.sh suffers from the same problem as
console-tools used to do, documented in #364797:
console-tools: console-screen.sh will grep noise instead of
LANG/LC_ALL/LC_TYPE
The attached patch fixes this, also syncing that part of the code up
with the state following #382115.
Thanks,
--
Colin Watson [EMAIL PROTECTED]
* Resynchronise debian/console-screen.kbd.sh with console-screen.sh from
console-tools, fixing dubious grepping of /etc/environment and
/etc/default/locale.
diff -u kbd-1.14.1/debian/console-screen.kbd.sh kbd-1.14.1/debian/console-screen.kbd.sh
--- kbd-1.14.1/debian/console-screen.kbd.sh
+++ kbd-1.14.1/debian/console-screen.kbd.sh
@@ -56,18 +56,11 @@
DEVICE_PREFIX="/dev/tty"
fi
-# read environment settings
-if [ -f /etc/environment ] || [ -f /etc/default/locale ]
-then
-for var in LANG LC_CTYPE LC_ALL
-do
- value=$(egrep "^[^#]*${var}=" /etc/environment /etc/default/locale 2>/dev/null | tail -n1 | cut -d= -f2)
- eval $var=$value
-done
-fi
-
# determine the system charmap
-CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap 2>/dev/null`
+ENV_FILE=''
+[ -r /etc/environment ] && ENV_FILE="/etc/environment"
+[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
+[ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)
if [ "$CHARMAP" = "UTF-8" -a -z "$CONSOLE_MAP" ]
then
UNICODE_MODE=yes