-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locale.gen mangling insufficiently parses format #940
Comments
We had a somewhat more flexible parsing there (but still without accepting whitespace before comments), but it was explicitly changed because some distros want a distinction between I objected to this distinction which is clearly not specified by the file format, but it was merged anyway. Since the distro I work with does not use |
Could be a bool flag in localecfg.conf Alternatively, the lines could be parsed entirely instead of doing a startswith approximation. |
The whole file is fishy, and I don't really like messing around with it one way or another:
Good luck making any sense out of that automatically. The original change was requested, I believe, because the locales listed as examples were enabled twice. If anything changes in this module, I'd move to not uncomment anything, but to copy the entire file and at the end list those locales that Calamares would have uncommented (once each) that appear in the input as comments following the RE |
If you can find a meaningful file-format description for locale.gen, I'd be grateful. The locale-gen manpage from Ubuntu says:
So that might be interpreted at the least as disallowing lines with a space before the comment character. Whether locale-gen actually follows that interpretation .. well, no. |
So, I've had a look at ubuntu, arch, debian and opensuse, and omg this is a mess. locale-gen isn't part of glibc, it's something distros add to manage locales easier than what localedef does.
The scripts are somewhat different even.
The seds look the same and I expect the scripts have some common ancestry somewhere, but given there is no definition or standard or anything behind this, it probably matters not. So, you can pretty much throw any format expectation out the window. For all we know Floppy Linux is using json as config format. example: https://git.archlinux.org/svntogit/packages.git/tree/trunk/locale-gen?h=packages/glibc Knowing what we know, I still think 100% whitespace handling would be the way to go as the likely least wrong option as far as the format is concerned. But! If we appreciate that this format is basically undefined we probably should let distros handle this i.e. instead of editing the format in cala it'd call distro provided scripts to do it. That way some can have arbitrary meaning of spaces, others can use json as config format, or no config at all.
Splitting it like that means ubuntu systems can simply defer to already existing tech in the locale gen tech and set This could obviously also be a single script which is called with all locales in the arguments, leaving it to the script to foreach the locales (slightly less lovely from an ubuntu pov though, but ultimately makes no difference). |
Submission type
localecfg has the following logic to enable (i.e. uncomment) locales in /etc/locale.gen
Lines are insufficiently parsed here. They'd fail when
what it should do is something along the line of (pseudo code)
The text was updated successfully, but these errors were encountered: