[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#500164: /etc/environment file is not dealt with by dpkg-reconfigure locales



Messing with the /etc/environment file is probably a bad idea as it is owned by the libpam packages and may contain user settings.

A lot of users are encountering this problem when upgrading from past versions, in particular when converting to UTF8. Doing nothing at all seems like a poor idea.

Attached is a patch to at least warn the user about the problem via the locales postinst script.
--- glibc-2.7.orig/debian/debhelper.in/locales.postinst	2009-03-19 14:20:41.000000000 -0400
+++ glibc-2.7/debian/debhelper.in/locales.postinst	2009-03-19 15:26:32.000000000 -0400
@@ -76,6 +76,16 @@
     fi
 fi
 
+# Make some noise if locale information is in /etc/environment (bug 500164)
+# File is owned by libpam, not locales, and may contain user settings
+if [ -s /etc/environment ] ; then
+    if grep -e LANG -e LC_ -c /etc/environment; then
+	echo "*** /etc/environment may contain outdated locale settings  ***"
+        echo "*** removal or modification of any existing LANG, LC_*, or ***"
+        echo "*** LANGUAGE parameters may be needed                      ***"
+    fi
+fi
+
 #DEBHELPER#
 
 exit 0

Reply to: