Commit Graph

35 Commits

Author SHA1 Message Date
Adriaan de Groot
33b4fd3a20 [localecfg] It's ok to have a missing /etc/locale.gen for reading 2022-04-19 08:25:34 +02:00
Adriaan de Groot
1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
2020-08-26 02:28:38 +02:00
Adriaan de Groot
863a4cc2a4 REUSE: (GPL-3.0-or-later) Python modules 2020-08-26 02:22:49 +02:00
Adriaan de Groot
1b23520f20 REUSE: (CC0-1.0) module descriptors and configuration files
In spite of there being considerable documentation sometimes in the
config file, we go with CC0 because we don't want the notion of
'derived work' of a config file.

The example `settings.conf` is also CC0. Add some docs to
it while we're at it.
2020-08-26 02:22:49 +02:00
Adriaan de Groot
cdd2b9cc79 Modules: set noconfig:true on Python modules
- hwclock, initramfs, localecfg and networkcfg don't have any
   config file to work with, so set that explicitly in the module.desc
2020-01-24 23:10:41 +01:00
Adriaan de Groot
ec0fe2ccd3 Modules: Improve error reporting
- [initcpio] remove superfluous inner function
 - [initcpio] catch errors from mkinitcpio itself and report them in a nice
   readable format.

 - Save translators the effort of doing a dozen messages
   with just the name of the module changed. All of these modules
   bail out on bad configurations with a meaningful message.
   - [initcpiocfg]
   - [fstab]
   - [initramfscfg]
   - [localecfg]
   - [luksbootkeyfile]
   - [luksopenswaphookcfg]

 - [machineid] Warn on bad config. It's conceivable that this is run
   with an empty rootMountPoint (i.e. "") to modify the running system,
   so only bail on None.
2019-04-28 14:34:39 -04:00
Adriaan de Groot
cf08e59501 [localecfg] Add missing import 2019-04-27 11:04:10 -04:00
Adriaan de Groot
e326b658ef Enable translation in Python modules
- covers all the remaining Python modules
 - most only get a translatable pretty name, some also return
   error messages
2019-04-20 11:22:32 +02:00
Adriaan de Groot
7e88f637b1 [localecfg] Fix error in string-formatting. 2018-09-30 18:56:48 +02:00
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.
2018-06-20 09:11:23 -04:00
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).
2018-06-20 08:35:18 -04:00
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.
2018-06-20 07:13:36 -04:00
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.
2018-06-19 08:56:37 -04:00
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
2018-06-19 08:46:50 -04:00
Adriaan de Groot
863d00f40c [localecfg] Document purpose of this module 2018-06-19 08:42:25 -04:00
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>
2018-06-15 05:59:11 -04:00
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
2018-03-03 14:30:08 +01:00
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
2018-03-03 12:56:03 +01:00
Adriaan de Groot
762ad54344 Documentation: change http links to GitHub to https 2017-12-20 08:39:09 -05:00
Teo Mrnjavac
2b26f6e6c9 Fix localecfg to work with new locale module. 2016-08-10 12:11:48 +02:00
Teo Mrnjavac
dee87f68aa And in GS, it's called localeConf now. 2016-08-10 11:47:36 +02:00
Teo Mrnjavac
01607d878a Write more LC variables in localecfg. 2016-07-26 17:39:55 +02:00
Teo Mrnjavac
f00d1dd654 Apparently it needs a full LANG line. 2016-05-30 17:10:18 +02:00
Teo Mrnjavac
9272d3d5b0 Write locale to /etc/default/locale. 2016-05-30 16:15:59 +02:00
Teo Mrnjavac
92d3f5fe85 Only strip from the left. 2016-05-27 18:18:10 +02:00
Teo Mrnjavac
893417d26e Strip spaces when uncommenting locales. 2016-05-27 16:58:39 +02:00
Teo Mrnjavac
10ce42f35c Use target_env calls in Python modules. 2015-09-15 16:48:41 +02:00
Gormogon
db7577b9f8 More PEP 2015-06-14 07:04:52 -04:00
Teo Mrnjavac
d51b15a919 Fix typo. Please test your Python code, as CI won't catch it. 2015-02-18 18:46:13 +01:00
Gormogon
8e1480431a [PEP 263] Corrected Encoding Headers 2015-02-18 09:06:10 -05:00
Philip Müller
ca5132f13e [python modules] use str.format() 2015-02-17 14:38:30 +01:00
Daniel Hillenbrand
22a9fd86df localecfg: only restore locale.gen.bak if available 2014-11-28 20:05:54 +01:00
demmm
86c49fbc89 Use correct entry from global_storage 2014-11-26 12:15:39 -05:00
Teo Mrnjavac
d2288d0961 Write lc locale setting from GlobalStorage. 2014-11-25 17:56:38 +01:00
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
2014-11-12 23:10:20 -05:00