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

Bug#782241: locales: On upgrade, generic locales as C.UTF-8 are lost in /etc/default/locale



Found: 2.13-1

On 2015-04-09 15:08, Vincent Danjean wrote:
> Package: locales
> Version: 2.19-17
> Severity: serious
> Tags: patch
> Justification: valid administator configuration is lost on upgrade
> 
>   Hi,
> 
>   The current debconf script for the 'locales' package does not allow to
> choose the C.UTF-8 locale. Moreover, if an administrator write this valid
> value for the LANG variable in /etc/default/locale, the value will be
> overwritten as soon as the 'locales' package is reconfigurated.
>   If I correctly follow the logic of the config script, one goal is to ensure
> that the chosen value is correct (i.e. supported). So, the current value
> is not always put in the debconf proposed list.

Indeed that is correct.

>   However, the C.UTF-8 value is valid (as are C and POSIX but I'm less sure
> of their value).

C and POSIX are already taken into account by the "None" choice, that is
the C or POSIX locale is the one selected when not set.

>   So, either the C.UTF-8 value (and perhaps C and POSIX) should be proposed
> when selecting the default environment locale, or, at very least, the config
> script must allow to keep it when it has manually be put into
> /etc/default/locale by the administrator.

Note (and especially for the release managers) that this behaviour is
already the one from wheezy. This is therefore not a regression and
therefore not a reason to delay the release of Jessie. I have updated the
version accordingly.

>   If you want to always allow this value, the current patch is enough:
> ===============
> --- locales.config	2015-03-14 10:30:53.000000000 +0100
> +++ /tmp/locales.config	2015-04-09 15:05:40.257852467 +0200
> @@ -547,9 +547,12 @@
>          fi
>          DEFAULT_LOCALES="$(echo $RET | sed -e 's/ [^ ]*,/,/g' -e 's/ [^ ]*$//')"
>          if [ -n "$DEFAULT_LOCALES" ]; then
> -            db_subst locales/default_environment_locale locales $DEFAULT_LOCALES
> -            db_input medium locales/default_environment_locale || true
> +            DEFAULT_LOCALES="C, C.UTF-8, POSIX, $DEFAULT_LOCALES"
> +        else
> +            DEFAULT_LOCALES="C, C.UTF-8, POSIX"
>          fi
> +        db_subst locales/default_environment_locale locales $DEFAULT_LOCALES
> +        db_input medium locales/default_environment_locale || true
>          ;;
>      *)
>          break
> ===============
>   Feel free to adjust the list of always supported locales (ie C and POSIX)
> 
>   If you want to only allow the C, C.UTF-8, and POSIX locales when they
> have been manually set up (so they do not show up on default install), I
> can provide an updated patch. Just tell me.

I think the correct way is to modify the template to always allow
C.UTF-8 (as is always provide) like it's done for the "None" locale. I
will do some tests and prepare an upload. 

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: