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

Bug#365628: postinst fails when LANG doesn't point to a valid locale



tags 365628 = pending
thanks

On Mon, May 01, 2006 at 05:49:33PM +0200, Robert Millan wrote:
> Package: locales
> Version: 2.3.6-7
> Severity: important
> Tags: patch
> 
> # LANG=xx_XX DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
> [...]
> *** update-locale: Error: invalid locale settings:
> 
> when "update-locale LANG" is invoked, it verified LANG variable and, if invalid,
> aborts the script.
> 
> The typical situation when this happens is:
> 
>   - You had belocs-locales-data installed.
>   - You had LANG set to a locale that is only available in belocs, and not in
>     glibc locales.
>   - You attempt to replace belocs-locales-data with glibc locales.
> 
> The following fix worked for me:
> 
> --- /var/lib/dpkg/info/locales.postinst~        2006-04-14 15:45:25.000000000 +0200
> +++ /var/lib/dpkg/info/locales.postinst 2006-05-01 17:46:22.000000000 +0200
> @@ -66,7 +66,7 @@
>      # Set default LANG environment variable
>      if [ -e $EE ]; then
>          # Remove previous definitions
> -        /usr/sbin/update-locale LANG
> +        LANG= /usr/sbin/update-locale LANG
>      fi
>      if [ -n "$SELECTED" ] && [ "$SELECTED" != "None" ]; then
>          /usr/sbin/update-locale "LANG=$SELECTED"

A slightly different fix has already been committed in SVN,
update-locale is called with the --no-checks flag.

> But according to the manpage, I don't see why update-locale should care about
> the LANG env variable.  Perhaps the problem is there?

Several problems have been reported because of inconsistencies between
LANG and LANGUAGE, so I try to make sure that selected locale is usable.
If these consistency checks make more harm than good, they will be dropped.

Denis



Reply to: