Confusing new locale-gen behavior
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
glibc (Ubuntu) |
Fix Released
|
High
|
Gunnar Hjalmarsson |
Bug Description
When the locales package was provided by the langpack-locales source package, you could call locale-gen with arguments. Examples:
sudo locale-gen en_US.UTF-8
(to generate that locale only)
sudo locale-gen --purge
(to purge all existing locales and create all locales)
With the locales package provided by glibc, the equivalent to the latter seems to be:
sudo locale-gen
What's problematic is that if you add an argument (any argument), the existing locales seem to be purged, but nothing is generated. I'd consider this to be a pretty serious regression, which will likely result in locale issues for many users, if something isn't done to fix it. I'm not sure how to best deal with the problem, though.
Well, after having looked at the /usr/sbin/ locale- gen script and done some further testing, I see that not *all* arguments are ignored. The synopsis seems to be:
locale-gen [[--keep-existing] LANGUAGE]
where LANGUAGE is the name of a file in /var/lib/ locales/ supported. d. (If you state multiple LANGUAGE arguments, only the last is recognized.) The --keep-existing option prevents purging of previously generated locales.
So basically you can
* Purge all existing locales and generate all locales in lib/locales/ supported. d
/var/
sudo locale-gen
* Purge all existing locales and generate the locales of *one* file locales/ supported. d
in /var/lib/
sudo locale-gen LANGUAGE
* [Re-]generate the locales of *one* file in lib/locales/ supported. d language-pack without purging
/var/
sudo locale-gen --keep-existing LANGUAGE
This is quite different compared to the way the old locale-gen worked.
* All locales are purged by default
* No simple way to generate locales included in SUPPORTED in addition
to the locales belonging to installed language packs.
* The man page is pretty useless.
I fear that this will result in a lot user confusion. Possibly there is some point with the new behavior, but at this time I fail to see it. In any case the change should be accompanied by some proper documentation.
I would suggest that we use the old locale-gen script (and the related man page) in 16.04. Then, post Xenial, we could consider more thoroughly what to do going forward.