summaryrefslogtreecommitdiff
path: root/src/locale
Commit message (Collapse)AuthorAgeFilesLines
* kbd-model-map: correct variants for cz-qwerty to include commaAdam Williamson2022-09-291-1/+1
| | | | | | | | | | | | As explained by @poncovka , the 'xvariant' string should contain the same number of comma-separated elements as 'xlayout'. When we have two layouts we need two items in xvariant, in this case one of them is empty. See https://github.com/rhinstaller/anaconda/pull/4355#pullrequestreview-1119913870 for @poncovka's full explanation. Signed-off-by: Adam Williamson <awilliam@redhat.com>
* kbd-model-map: add a mapping for switched czech qwerty/usAdam Williamson2022-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=2121106 for the background on this. One of Fedora's QA folks ran an install and chose two keyboard layouts: Czech (qwerty) and US. Due to the sad details of how the whole logic flow for trying to decide what kbd layout best matches a given xkb config works (see details in the bug comments), we wound up deciding the best- matching kbd layout for this situation was cz-us-qwertz, which is a czech/us switched layout, but is qwertz, not qwerty. This seems like a poor outcome. Adding this line should result in us picking cz-qwerty in this case. Which may be the 'legacy' cz-qwerty.map from upstream kbd project (which is switched cz/us), or may be the auto-converted xkb layout (which obviously isn't switched). But either way, at least its primary mode is Czech qwerty, which seems like a *better* choice than a layout whose primary mode is Czech qwertz. Signed-off-by: Adam Williamson <awilliam@redhat.com>
* shared/format-table: use enum instead of Table.empty_stringZbigniew Jędrzejewski-Szmek2022-09-221-3/+1
| | | | | | | | | | | | All users were setting this to some static string (usually "-"), so let's simplify things by not doing strdup, but instead limiting callers to a fixed set of values. In preparation for the next commit, the function is renamed from "empty" to "replacement", because it'll be used for more than empty fields. I didn't do the whole string-table setup, because it's all used internally in one file and this way we can immediately assert if an invalid value is passed in. Some callers were (void)ing the error, others were ignoring it, and others propagating. It's nicer to remove the boilerplate.
* hostnamectl,localectl: use "(unset)" in empty fieldsZbigniew Jędrzejewski-Szmek2022-09-211-1/+1
| | | | | "n/a" is more ambiguous: not available or not set or maybe we didn't check it. Let's just say directly that the field is not set.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-132-15/+6
|
* localed: don't fail if we cannot copy an xattrLennart Poettering2022-07-251-1/+1
| | | | | | | We ignore xattr copy failures on all other cases, and we should do so here too. Fixes: #24106
* Use https for freedesktop.orgMichael Biebl2022-06-282-2/+2
| | | | grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
* locale: drop unnecessary allocationYu Watanabe2022-06-181-4/+0
| | | | | | Fixes a bug introduced by 3d36b5d7e7b191fca7c5c65dbab94d99cf5f0230. Fixes #23777.
* localectl: use Table to show statusYu Watanabe2022-06-141-40/+89
|
* locale: rename keymap-util.[ch] -> localed-util.[ch]Yu Watanabe2022-06-145-9/+8
| | | | As the file contains not only keymap related functions.
* locale-setup: merge locale handling in PID1 and localedYu Watanabe2022-06-144-208/+35
|
* strv: declare iterator of FOREACH_STRING() in the loopZbigniew Jędrzejewski-Szmek2022-03-231-1/+1
| | | | | | | | | | | Same idea as 03677889f0ef42cdc534bf3b31265a054b20a354. No functional change intended. The type of the iterator is generally changed to be 'const char*' instead of 'char*'. Despite the type commonly used, modifying the string was not allowed. I adjusted the naming of some short variables for clarity and reduced the scope of some variable declarations in code that was being touched anyway.
* strv: make iterator in STRV_FOREACH() declaread in the loopYu Watanabe2022-03-192-3/+0
| | | | This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
* various: make parse_env_file error handling the same in various placesZbigniew Jędrzejewski-Szmek2022-03-181-8/+3
| | | | | No big reason to do this, except that I was looking at all call sites and it's nicer if the same style is used accross the codebase.
* test: Use TEST macros in more placesJan Janssen2022-03-161-26/+9
|
* meson: move files' closing brace to separate lineZbigniew Jędrzejewski-Szmek2022-03-031-1/+2
|
* meson: do not use split() in file listsZbigniew Jędrzejewski-Szmek2022-03-021-5/+4
| | | | | | | | | | | The approach to use '''…'''.split() instead of a list of strings was initially used when converting from automake because it allowed identical blocks of lines to be used for both, making the conversion easier. But over the years we have been using normal lists more and more, especially when there were just a few filenames listed. This converts the rest. No functional change.
* Merge pull request #22092 from keszybz/docs-linksZbigniew Jędrzejewski-Szmek2022-01-121-1/+1
|\ | | | | Add more doc pages, adjust links, add explanatory headers to examples and relax license to CC-0
| * policy files: adjust landing page linkZbigniew Jędrzejewski-Szmek2022-01-121-1/+1
| |
* | meson: Use files() for testsJan Janssen2022-01-111-3/+3
|/ | | | | | Not having to provide the full path in the source tree is much nicer and the produced lists can also be used anywhere in the source tree.
* shared: clean up mkdir.h/label.h situationLennart Poettering2021-11-161-1/+1
| | | | | | | | | | Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
* test: use kbd-mode-map we ship in one more test caseYu Watanabe2021-11-111-1/+1
| | | | | | Follow-up for be0cc2ce6c947aafadb3f42dba405269f670b31c. Fixes https://github.com/systemd/systemd/pull/19670#issuecomment-965817823.
* Merge pull request #20138 from keszybz/coding-style-variable-declsLuca Boccassi2021-11-051-3/+3
|\ | | | | A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
| * Make pager_open() return voidZbigniew Jędrzejewski-Szmek2021-11-031-3/+3
| |
* | Merge pull request #21229 from keszybz/improve-m-hintLuca Boccassi2021-11-041-1/+1
|\ \ | | | | | | Improve hint to use -M in various tools
| * | tree-wide: do not print hint about -M if -M is already usedZbigniew Jędrzejewski-Szmek2021-11-041-1/+1
| |/ | | | | | | | | | | | | | | (Or when -H is used, since -H and -M are incompatible.) Note that the slightly unusual form with separate boolean variables (hint_vars, hint_addr) instead of e.g. a const char* variable to hold the message, because this way we don't trigger the warning about non-literal format.
* | test-keymap-util: always use kbd-model-map we shipFranck Bui2021-11-021-0/+5
|/ | | | | | | | | | | | | This test makes assumptions on the availability of some mappings contained in kbd-model-map and therefore strongly relies on the version shipped by upstream. IOW the test is likely to fail if it's installed on a system with a more comprehensive kbd-model-map. This patch makes the upstream kbd-model-map file available via a symlink in test/testdata/test-keymap-util dir and makes sure that this specific version is always used by test-keymap-util regardless of whether the test is installed and run on a different system or directly run (optionally via meson) from the project working dir.
* alloc-util: add strdupa_safe() + strndupa_safe() and use it everywhereLennart Poettering2021-10-141-2/+3
| | | | | | | | | | | | | Let's define two helpers strdupa_safe() + strndupa_safe() which do the same as their non-safe counterparts, except that they abort if called with allocations larger than ALLOCA_MAX. This should ensure that all our alloca() based allocations are subject to this limit. afaics glibc offers three alloca() based APIs: alloca() itself, strndupa() + strdupa(). With this we have now replacements for all of them, that take the limit into account.
* localed: use PROJECT_FILE rather than __FILE__ for loggingLennart Poettering2021-10-111-1/+1
| | | | | All our log.h code uses PROJECT_FILE for this, let's hence use it here too.
* tree-wide: remove a few unnecessary inclusions of ftw.hLennart Poettering2021-10-071-1/+0
|
* shared/copy: add a new flag COPY_ALL_XATTRSAndrej Lajovic2021-08-111-1/+1
| | | | | | | | When the flag COPY_ALL_XATTRS is set, it causes the complete set of xattrs to be copied. If the flag is unset, only xattrs from the "user" namespace are copied. Fixes #17178.
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-032-3/+3
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* meson: use a/b instead of join_paths(a,b)Zbigniew Jędrzejewski-Szmek2021-07-271-2/+2
| | | | It is nicer and shorter.
* kbd-model-map: add Latvian keyboard layout mappingnl67202021-06-101-0/+2
|
* kbd-model-map: add mapping 'es-dvorak'Franck Bui2021-05-192-4/+5
| | | | | | And update test-keymap-util accordingly. While at it, make sure to use tabs everywhere.
* meson: call find_program() once and reuse the variable everywhereZbigniew Jędrzejewski-Szmek2021-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved.
* tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-142-2/+2
| | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* tree-wide: sd_bus_error_setf → set_bus_error_setZbigniew Jędrzejewski-Szmek2021-04-071-4/+4
| | | | strdup() is more efficient than asprintf().
* localed: refuse to set a keymap which is not installedZbigniew Jędrzejewski-Szmek2021-03-041-6/+13
| | | | | | | | | | | | | | | | | | | In https://bugzilla.redhat.com/show_bug.cgi?id=1933873 a keymap was set without the package that provides it being installed (it2 is in kbd-legacy, which is not installed by default). Setting a non-installed keymap is problematic, because it results in nasty failures afterward (*). So let's to the same as e.g. for locale data, and refuse a setting if the definition doesn't exists in the filesystem. The implementation using nftw() is not the most efficient, but I think it's OK in this case. This is definitely not in any kind of hot path, and I prefer not to duplicate the filename manipulation logic in a second function. (*) If the keymap is not found, vconsole-setup.service will fail. dracut-cmdline-ask.service has Requires=vconsole-setup.service, so it will also fail, and this breaks boot. dracut-cmdline-ask.service having a hard dependency is appropriate though: we sadly don't display what the keymap is, and with a wrong keymap, any attempts to enter a password are likely to fail.
* basic/env-util: add strv_env_assign() helperZbigniew Jędrzejewski-Szmek2021-02-161-52/+12
|
* locale: inline iterator variable declarationsZbigniew Jędrzejewski-Szmek2021-02-163-18/+10
|
* tree-wide: enable colorized logging for daemons when run in consoleYu Watanabe2021-02-012-2/+2
| | | | It may be useful when debugging daemons.
* tree-wide: Drop custom formatting for print() help messagesDaan De Meyer2021-01-311-6/+5
| | | | | | | | | | | | I think this formatting was originally used because it simplified adding new options to the help messages. However, these days, most tools their help message end with "\nSee the %s for details.\n" so the final line almost never has to be edited which eliminates the benefit of the custom formatting used for printf() help messages. Let's make things more consistent and use the same formatting for printf() help messages that we use everywhere else. Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
* meson: make the second and third elements of tests or fuzzers optionalYu Watanabe2021-01-191-3/+1
| | | | Then, we can shorten many test definitions.
* localed: Run locale-gen if available to generate missing localeMatthias Klumpp2021-01-124-4/+276
| | | | | | | | | | | This change improves integration with distributions using locale-gen to generate missing locale on-demand, like Debian-based distributions (Debian/Ubuntu/PureOS/Tanglu/...) and Arch Linux. We only ever enable new locales for generation, and never disable them. Furthermore, we only generate UTF-8 locale. This feature is only used if explicitly enabled at compile-time, and will also be inert at runtime if the locale-gen binary is missing.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-099-9/+9
|
* tree-wide: don't needlessly negate error number passed to bus_error_message()Lennart Poettering2020-09-141-3/+3
| | | | | | Like it's customary in our codebase bus_error_message() internally takes abs() of the passed error anyway, hence no need to explicitly negate it. We mostly got this right, but in too many cases we didn't. Fix that.
* Rename strv_split_extract() to strv_split_full()Zbigniew Jędrzejewski-Szmek2020-09-091-3/+3
| | | | | Now that _full() is gone, we can rename _extract() to have the usual suffix we use for the more featureful version.
* bus: use bus_log_connect_error to print error messagefangxiuning2020-07-211-1/+1
|
* shared: split out code that maps properties to local structsLennart Poettering2020-06-301-0/+1
| | | | Just some refactoring, no code changes.