Commit 918f4c69 authored by Gustavo Sverzut Barbieri's avatar Gustavo Sverzut Barbieri Committed by Lennart Poettering
Browse files

gentoo: locale-setup support

Use locale variables from /etc/profile.env as Gentoo's openrc
runscript does (tool that is used by /etc/init.d/* services).
parent 9841e8e3
......@@ -84,6 +84,32 @@ int locale_setup(void) {
if (r != -ENOENT)
log_warning("Failed to read /etc/rc.conf: %s", strerror(-r));
#elif defined(TARGET_GENTOO)
/* Gentoo's openrc expects locale variables in /etc/env.d/
* These files are later compiled by env-update into shell
* export commands at /etc/profile.env, with variables being
* exported by openrc's runscript (so /etc/init.d/)
if ((r = parse_env_file("/etc/profile.env", NEWLINE,
"export LANG", &variables[VARIABLE_LANG],
"export LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
"export LC_NUMERIC", &variables[VARIABLE_LC_NUMERIC],
"export LC_TIME", &variables[VARIABLE_LC_TIME],
"export LC_COLLATE", &variables[VARIABLE_LC_COLLATE],
"export LC_ALL", &variables[VARIABLE_LC_ALL],
"export LC_PAPER", &variables[VARIABLE_LC_PAPER],
"export LC_NAME", &variables[VARIABLE_LC_NAME],
"export LC_ADDRESS", &variables[VARIABLE_LC_ADDRESS],
NULL)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /etc/profile.env: %s", strerror(-r));
/* Override distribution-specific options with the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment