Bug#274289: locales: postinst should not overwrite settings in /etc/environment
At Thu, 30 Sep 2004 22:38:04 +0200,
Adeodato Sim�ote:
> [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.
BTW, why do you want to maintain this file manually? Is
dpkg-reconfigure locales insufficient for you?
> 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.
Yeah, it seems we should improve this issue for /etc/environment.
"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.
Denis, how about this idea?
> [2 postinst.diff <text/plain; us-ascii (7bit)>]
> --- 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
It's sure this patch cannot be applied straightforwardly because it
ignores the comment argument.
Regards,
-- gotom
Reply to: