summaryrefslogtreecommitdiff
path: root/src/locale
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* shared: actually move all BusLocator related calls to bus-locator.cLennart Poettering2020-06-301-1/+1
|
* log: introduce log_parse_environment_cli() and log_setup_cli()Filipe Brandenburger2020-06-241-3/+1
| | | | | | | | | | | | | | | | Presently, CLI utilities such as systemctl will check whether they have a tty attached or not to decide whether to parse /proc/cmdline or EFI variable SystemdOptions looking for systemd.log_* entries. But this check will be misleading if these tools are being launched by a daemon, such as a monitoring daemon or automation service that runs in background. Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI variables to determine the logging level. Furthermore, introduce a new log_setup_cli() shortcut to set up common options used by most command-line utilities.
* Merge pull request #16112 from poettering/nss-systemd-block-fixLennart Poettering2020-06-242-3/+3
|\ | | | | rework nss-systemd recursion lock
| * util: add dlfcn-util.hLennart Poettering2020-06-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This just adds a _cleanup_ helper call encapsulating dlclose(). This also means libsystemd-shared is linked against libdl now. I don't think this is much of an issue, since libdl is part of glibc anyway, and anything from exotic. It's not an optional part of the OS (think: NSS requires dynamic linking), hence this pulls in no deps and is almost certainly loaded into all process' memory anyway. [zj: use DEFINE_TRIVIAL_CLEANUP_FUNC().]
* | Make failures of mac_selinux_init() fatalChristian Göttsche2020-06-231-1/+4
|/
* tree-wide: use DISABLE_WARNING_FORMAT_NONLITERAL where appropriateLennart Poettering2020-05-251-3/+2
|
* Merge pull request #15651 from poettering/newlocale-checkZbigniew Jędrzejewski-Szmek2020-05-081-34/+53
|\ | | | | check if locales are installed before using them
| * tree-wide: port various bits over to locale_is_installed()Lennart Poettering2020-05-071-34/+53
| |
* | locale: switch to BusLocator-oriented helpersVito Caputo2020-05-071-15/+5
|/ | | | Mechanical substitution reducing some verbosity
* localed: convert to the new scheme and add --bus-introspectZbigniew Jędrzejewski-Szmek2020-05-051-3/+10
|
* importd,logind: add --bus-introspect= optionZbigniew Jędrzejewski-Szmek2020-05-051-0/+1
|
* logind,importd,hostnamed,localed,timedated,machined,resolved: add option ↵Zbigniew Jędrzejewski-Szmek2020-05-031-3/+7
| | | | | | | | parsing stubs --help and --version are implemented in the usual style. help() prints full path, since the program is not expected to be in $PATH.
* tree-wide: implement new log control API dbus interface in all our daemonsLennart Poettering2020-04-211-0/+5
|
* Merge pull request #15396 from keszybz/dbus-api-docsLennart Poettering2020-04-171-3/+29
|\ | | | | D-bus API docs
| * localed: add dbus parameter namesZbigniew Jędrzejewski-Szmek2020-04-121-3/+29
| |
* | Remove unneded {}sZbigniew Jędrzejewski-Szmek2020-04-131-2/+1
|/ | | | | | $ perl -i -0pe 's|\s+{\n([^\n]*;)\n\s+}\n|\n\1\n|gms' **/*.c Inspired by ea7cbf5bdd68d7861ebf1570c439e8bbabd83f6c.
* shared: split out polkit stuff from bus-util.c → bus-polkit.cLennart Poettering2020-01-222-2/+2
| | | | | | It's enough, complex stuff to warrant its own source file. No other changes, just splitting out.