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

Bug#274289: locales: postinst should not overwrite settings in /etc/environment



At Fri, 1 Oct 2004 20:56:46 +0200,
Denis Barbier wrote:
> > "None" means "I don't want to set LANG variable to /etc/environment".
> >
> > In this case, I think adding "Don't touch /etc/environment" entry is
> > appropriate like "Don't touch keymap" in console related package (I
> > forgot the actual package name, but I guess you know it).  In
> > addition, "None" is vague name - I propose it as "Don't set LANG" and
> > so on.
> 
> No, locales.config parses this file in order to catch user's settings.
> I can see two reasons why this could fail:
>   a. locales.config is unable to parse /etc/environment.

It's no problem.  locales.config just parses /etc/environment even if
there's unknown LANG settings.  Is this proposed patch insufficient
for /var/lib/dpkg/info/locales?

--- locales.postinst	2004-09-28 00:22:48.000000000 +0900
+++ locales.postinst	2004-10-02 10:14:38.000000000 +0900
@@ -53,6 +53,7 @@
     /usr/sbin/locale-gen
 
     # Set default LANG environment variable
+  if [ "$SELECTED" != "Don't modify settings" ]; then
     if [ -e $EE ]; then
         sed -e '/^ *LANG=/d' $EE > $EE.tmp || true
         #  $EE has to be updated if $SELECTED is empty or 'None'
@@ -68,6 +69,7 @@
         cat -s $EE.tmp > $EE
     fi
     rm -f $EE.tmp
+  fi
 fi
 
 # We remove a relic of the past /usr/doc/<package> symlinks.
--- locales.templates	2004-09-28 00:22:46.000000000 +0900
+++ locales.templates	2004-10-02 10:14:38.000000000 +0900
@@ -111,7 +111,7 @@
 
 Template: locales/default_environment_locale
 Type: select
-Choices: None, ${locales}
+Choices: None, Don't modify settings, ${locales}
 Choices-cs.ISO-8859-2: ®ádné, ${locales}
 Choices-da.ISO-8859-1: Ingen, ${locales}
 Choices-de.ISO-8859-15: Keine, ${locales}

>   b. The selected locale is not listed in SUPPORTED.
> About (a), the format of /etc/environment is mostly unspecified, so
> it is not worth trying to fix this parsing, the right solution is to
> let the locales package handle its own configuration file.

I would like to know: why can console-data have "Don't touch keymap",
but can't locales have "Don't touch /etc/environment"?

> About (b), I am not sure how to best fix it, but this bugreport should
> then be retitled.

I think there're two reasons to improve this area:

  (1) Some locales have alias name because of historical reason.  For
      example, ja_JP.EUC-JP is listed in SUPPORTED, but I prefer to
      use ja_JP.eucJP.  eucJP is alias of EUC-JP.

  (2) If we want to use new locale for local experiment, we have no
      idea to keep such locale in /etc/environment.  It's not enough
      reason for users, though.

So I think "Don't touch /etc/environment" is good idea to introduce it.

Regards,
-- gotom




Reply to: