Re: [PATCH] Set LC_ALL instead LC_COLLATE in mkbuiltins
Fredrik Fornwall fred...@fornwall.net wrote: In mkbuiltins LC_COLLATE is set, but since The value of the LC_ALL environment variable has precedence over any of the other environment variables starting with LC_ (http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html), this has no effect when LC_ALL is set. This breaks when having e.g. LC_ALL=en_US.UTF-8 during make, which causes the test case dash -c : to fail, probably due to broken ordering in builtins.c. The patch corrects that by setting LC_ALL instead of LC_COLLATE. This causes any errors printed by sort to come out in English. Please fix this by simply setting LC_ALL to empty alongside LC_COLLATE=C. Thanks, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Set LC_ALL instead LC_COLLATE in mkbuiltins
On 05/21/2015 10:25 PM, Herbert Xu wrote: Fredrik Fornwall fred...@fornwall.net wrote: In mkbuiltins LC_COLLATE is set, but since The value of the LC_ALL environment variable has precedence over any of the other environment variables starting with LC_ (http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html), this has no effect when LC_ALL is set. This breaks when having e.g. LC_ALL=en_US.UTF-8 during make, which causes the test case dash -c : to fail, probably due to broken ordering in builtins.c. The patch corrects that by setting LC_ALL instead of LC_COLLATE. This causes any errors printed by sort to come out in English. Why do you care whether any errors printed by sort are in the C locale (in English) rather than localized? Ideally, there won't be any sort errors in the first place, because this tool is run on controlled input as part of the build process. Please fix this by simply setting LC_ALL to empty alongside LC_COLLATE=C. Setting LC_ALL has the nice property that LC_COLLATE and LC_CTYPE are guaranteed to be compatible; if you just set LC_COLLATE but leave LC_CTYPE unchanged and unset LC_ALL, it is possible to attempt a collation that assumes one character set while still living in a ctype that assumes another, and get garbled results. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: [PATCH] Set LC_ALL instead LC_COLLATE in mkbuiltins
On Thu, May 21, 2015 at 10:40:19PM -0600, Eric Blake wrote: Why do you care whether any errors printed by sort are in the C locale (in English) rather than localized? Ideally, there won't be any sort errors in the first place, because this tool is run on controlled input as part of the build process. Your /tmp could be full or sort could be out of memory. Setting LC_ALL has the nice property that LC_COLLATE and LC_CTYPE are guaranteed to be compatible; if you just set LC_COLLATE but leave LC_CTYPE unchanged and unset LC_ALL, it is possible to attempt a collation that assumes one character set while still living in a ctype that assumes another, and get garbled results. Show me an actual pair of values for these two that produce incorrect results for mkbuiltins and I'll happily change both. Cheers, -- Email: Herbert Xu herb...@gondor.apana.org.au Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line unsubscribe dash in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html