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 [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Processed: Re: Bug#365628: postinst fails when LANG doesn't point to a valid locale
Processing commands for [EMAIL PROTECTED]: tags 365628 pending Bug#365628: postinst fails when LANG doesn't point to a valid locale There were no tags set. Tags added: pending thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#365628: postinst fails when LANG doesn't point to a valid locale
tags 365628 pending thanks On Thu, Jul 27, 2006 at 06:38:43PM +0200, Robert Millan wrote: On Fri, May 05, 2006 at 01:55:09AM +0200, Denis Barbier wrote: AIUI, the checks update-locale is expected to do (and those --no-checks avoids) are the ones passed as arguments (ala update-locale LANG=foo). The manpage doesn't make any reference to variables passed through the environment. You are right, this is fixed now. 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, but I add --no-checks for now. Thanks for your report. Denis -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#365628: postinst fails when LANG doesn't point to a valid locale
reopen 365628 thanks On Fri, May 05, 2006 at 01:55:09AM +0200, Denis Barbier wrote: AIUI, the checks update-locale is expected to do (and those --no-checks avoids) are the ones passed as arguments (ala update-locale LANG=foo). The manpage doesn't make any reference to variables passed through the environment. You are right, this is fixed now. 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). Do you want me to send a patch for either of these? -- Robert Millan My spam trap is [EMAIL PROTECTED] Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Processed: Re: Bug#365628: postinst fails when LANG doesn't point to a valid locale
Processing commands for [EMAIL PROTECTED]: reopen 365628 Bug#365628: postinst fails when LANG doesn't point to a valid locale 'reopen' is deprecated when a bug has been closed with a version; use 'found' or 'submitter' as appropriate instead. Bug reopened, originator not changed. thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#365628: postinst fails when LANG doesn't point to a valid locale
On Wed, May 03, 2006 at 03:30:56PM +0200, Robert Millan wrote: 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. AIUI, the checks update-locale is expected to do (and those --no-checks avoids) are the ones passed as arguments (ala update-locale LANG=foo). The manpage doesn't make any reference to variables passed through the environment. You are right, this is fixed now. Thanks. Denis -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#365628: postinst fails when LANG doesn't point to a valid locale
On Wed, May 03, 2006 at 01:43:58AM +0200, Denis Barbier wrote: -/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. AIUI, the checks update-locale is expected to do (and those --no-checks avoids) are the ones passed as arguments (ala update-locale LANG=foo). The manpage doesn't make any reference to variables passed through the environment. (that said, if postinst works I don't really mind..) -- Robert Millan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Processed: Re: Bug#365628: postinst fails when LANG doesn't point to a valid locale
Processing commands for [EMAIL PROTECTED]: tags 365628 = pending Bug#365628: postinst fails when LANG doesn't point to a valid locale Tags were: patch Tags set to: pending thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
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.0 +0200 +++ /var/lib/dpkg/info/locales.postinst 2006-05-01 17:46:22.0 +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 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#365628: postinst fails when LANG doesn't point to a valid locale
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.0 +0200 +++ /var/lib/dpkg/info/locales.postinst 2006-05-01 17:46:22.0 +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 But according to the manpage, I don't see why update-locale should care about the LANG env variable. Perhaps the problem is there? -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.15-1-amd64-k8 Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Versions of packages locales depends on: ii debconf [debconf-2.0] 1.4.72 Debian configuration management sy ii libc6 [glibc-2.3.6-2] 2.3.6-7GNU C Library: Shared libraries locales recommends no packages. -- debconf information excluded -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]