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

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



Package: locales
Version: 2.3.2.ds1-17
Severity: wishlist

  [setting severity to wishlist as per GOTO Masanori's request. I would
  have gone for a much higher one, though.]

  problem: locales.postinst overwrites the LANG setting in
  /etc/environment in each upgrade, making it impossible to manually
  maintain it.

  though it should *never* modify it, one would expect *at* *least*, for
  it to remain untouched if the answer to "default_environment_locale"
  is "None" (which is my case). currently is not the case: with "None"
  as an answer, the LANG seting in $EE gets deleted.

  quoting Michael Tokarev in #274208:

    [...] debconf database is only a cache for configuration questions,
    and should NOT be used to STORE the config info, which, if needed,
    should be retrieved from actual config files [...] during upgrade.

  I would expect at least the attached patch to be applied to
  locales.postinst (minimal patch, just to express what I mean; could be
  done better).

  thanks,

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-1-686
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8

Versions of packages locales depends on:
ii  debconf                     1.4.38       Debian configuration management sy
ii  libc6 [glibc-2.3.2.ds1-17]  2.3.2.ds1-17 GNU C Library: Shared libraries an

-- debconf information:
* locales/default_environment_locale: None

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
The difference between literature and journalism is that journalism is
unreadable and literature is not read.
                -- Oscar Wilde
--- locales.postinst.old	2004-09-30 22:34:26.000000000 +0200
+++ locales.postinst	2004-09-30 22:36:57.000000000 +0200
@@ -56,11 +56,11 @@
     if [ -e $EE ]; then
         sed -e '/^ *LANG=/d' $EE > $EE.tmp || true
         #  $EE has to be updated if $SELECTED is empty or 'None'
-        cp -f $EE.tmp $EE
     else
         :> $EE.tmp
     fi
     if [ -n "$SELECTED" ] && [ "$SELECTED" != "None" ]; then
+        cp -f $EE.tmp $EE
         #   Add a newline in case last line does not have one
         echo >> $EE.tmp
         echo "LANG=$SELECTED" >> $EE.tmp

Reply to: