Commit Graph

26 Commits (47b130c5399b293602c5be4e2568ab8f89287225)

Author SHA1 Message Date
Adriaan de Groot 25f249180b [localecfg] Be slightly more conservative interpreting comments
- A valid line (as explained in the comments at the top of
   the locale.gen file) is <locale> <encoding> (two fields),
   so lines with more than two fields can't be valid locale-
   listing lines. For them, pretend they name locale "",
   which won't be matched.
Adriaan de Groot 8551653575 [localecfg] Re-write the locale.gen file better
- Improved debug-logging
 - Fix the actual problem of listing locales more than once,
   by listing them all, uniqified, at the end, with an explanitory
   comment in the generated file.
 - Be more accepting of what constitutes a locale-line; this allows
   spaces before and after the `#` comment sign, but because we're
   uniquifying, this doesn't cause duplicates.
 - Because we write the enabled locales at the end, the full file
   comment-header is retained un-mangled (instead of accidentally
   enabling a locale mentioned as an example there).
Adriaan de Groot 413ee81ead [localecfg] Simplify handling of en_US
- By adding en_US to the set of locales-to-enable, we can
   drop the special-case code for it.
Adriaan de Groot efc977f7b4 [localecfg] Fix mismatch between filenames
Testing for existence of a file in the live system, and then
copying it in the target system, is not a recipe for success.

 - Fix the restore-from-backup part.
 - Document that your live and target system must both have
   /etc/locale.gen if you want this to work at all.
Adriaan de Groot 7498629b5f [localecfg] Move all path-setting to one spot
- Make the way the paths are constructed consistent
 - Name the paths more consistently
Adriaan de Groot 863d00f40c [localecfg] Document purpose of this module
Adriaan de Groot dd8e53dc22 Copyright: update copyright lines on files touched in 2018
Contributions from:
  Adriaan de Groot <groot@kde.org>
  Gabriel Craciunescu <crazy@frugalware.org>
  AlmAck <gluca86@gmail.com>
  Andrius Štikonas <andrius@stikonas.eu>
  Caio Carvalho <caiojcarvalho@gmail.com>
  Raul Rodrigo Segura <raurodse@gmail.com>
AlmAck 58952b685c the first character must be a comment
to original code would match both lines:
zen_US.UTF-8 UTF-8
#en_US.UTF-8 UTF-8

introducing "#" should check only the commented lines
AlmAck 382c193afa Enable the correct language in the locale.gen list
the original code does not distinguish the document comments inside the locale.gen file from the real locale list. The language was then enabled from the header comments of the file instead of the correct value in the list.

The new code verify tha the complete locale string is just after the first character of the string, enablig only the correct value of the locale list.
An example:
#  en_US.UTF-8 UTF-8 --> document header, should not be enabled
#en_US.UTF-8 UTF-8 --> correct section to enable

Related to this request:
https://code.chakralinux.org/tools/calamares-chakra/issues/2
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https
Teo Mrnjavac 2b26f6e6c9 Fix localecfg to work with new locale module.
Teo Mrnjavac dee87f68aa And in GS, it's called localeConf now.
Teo Mrnjavac 01607d878a Write more LC variables in localecfg.
Teo Mrnjavac f00d1dd654 Apparently it needs a full LANG line.
Teo Mrnjavac 9272d3d5b0 Write locale to /etc/default/locale.
Teo Mrnjavac 92d3f5fe85 Only strip from the left.
Teo Mrnjavac 893417d26e Strip spaces when uncommenting locales.
Teo Mrnjavac 10ce42f35c Use target_env calls in Python modules.
Gormogon db7577b9f8 More PEP
Teo Mrnjavac d51b15a919 Fix typo. Please test your Python code, as CI won't catch it.
Gormogon 8e1480431a [PEP 263] Corrected Encoding Headers
Philip Müller ca5132f13e [python modules] use str.format()
Daniel Hillenbrand 22a9fd86df localecfg: only restore locale.gen.bak if available
demmm 86c49fbc89 Use correct entry from global_storage
Teo Mrnjavac d2288d0961 Write lc locale setting from GlobalStorage.
demmm ff1383d7f5 adding localecfg
locale hardcoded to en_US until local globalstorage is available
run pep8 on bootloader main.py, plain switch from subprocess to chroot_call fails for gummiboot call