summaryrefslogtreecommitdiff
path: root/src/locale-setup.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2010-09-21 00:49:13 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-21 00:49:13 +0200
commit918f4c69fabadc328b5ca3bbd9eb73c3e486e103 (patch)
treebfd9a202e135411722e2925092296c09010566c8 /src/locale-setup.c
parent9841e8e3d305e6f4173c9aedbe8d57adfe10d145 (diff)
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).
Diffstat (limited to 'src/locale-setup.c')
-rw-r--r--src/locale-setup.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/locale-setup.c b/src/locale-setup.c
index 675a739a5..06c2ee77f 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -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_MONETARY", &variables[VARIABLE_LC_MONETARY],
+ "export LC_MESSAGES", &variables[VARIABLE_LC_MESSAGES],
+ "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],
+ "export LC_TELEPHONE", &variables[VARIABLE_LC_TELEPHONE],
+ "export LC_MEASUREMENT", &variables[VARIABLE_LC_MEASUREMENT],
+ "export LC_IDENTIFICATION", &variables[VARIABLE_LC_IDENTIFICATION],
+ NULL)) < 0) {
+
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/profile.env: %s", strerror(-r));
+ }
#endif
/* Override distribution-specific options with the