[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

On Fri, Aug 11, 2006 at 12:21:04AM +0200, Denis Barbier wrote:
> On Thu, Jul 27, 2006 at 06:38:43PM +0200, Robert Millan wrote:
> > 
> > OTOH, LANG is being passed as parameter now:
> > 
> >     if [ -n "$SELECTED" ] && [ "$SELECTED" != "None" ]; then
> >         /usr/sbin/update-locale "LANG=$SELECTED"
> >     fi
> > 
> > Unfortunately you can't trust "locales/locales_to_be_generated" as generated by
> > locales.config, because this script could have been run in a previous version of
> > locales that includes entries that are no longer valid.
> > 
> > One solution would be to add "--no-checks".  Another, to check $SELECTED against
> > __SUPPORTED_LOCALES__ to ensure it's in the list (and otherwise fallback to
> > LANG=C).
> I still believe that something should be done when user selects non
> working locales,

We could check locales_to_be_generated against the current list of locales,
and if one of the locales that is no longer present has been selected, we
migrate it using a list of known disappeared locales and their subtitutes
(and use "None" as fallback substitute if the disappeared locale isn't known).

As for default_environment_locale, we can wrap such check within a function
and use it here, too.

Would you like a patch for that?

> but I add --no-checks for now.

Ok thanks.

Robert Millan

My spam trap is honeypot@aybabtu.com.  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.

Reply to: