2013-04-23 11:39:56 +02:00
|
|
|
From: Frederic Crozat <fcrozat@suse.com>
|
|
|
|
Date: Tue, 4 Dec 2012 16:51:32 +0000
|
|
|
|
Subject: handle root_uses_lang value in /etc/sysconfig/language
|
|
|
|
|
|
|
|
handle ROOT_USES_LANG=ctype (bnc#792182).
|
|
|
|
---
|
|
|
|
src/core/locale-setup.c | 27 +++++++++++++++++++++++++++
|
|
|
|
1 file changed, 27 insertions(+)
|
|
|
|
|
2013-10-04 16:07:46 +02:00
|
|
|
Index: systemd-208/src/core/locale-setup.c
|
|
|
|
===================================================================
|
|
|
|
--- systemd-208.orig/src/core/locale-setup.c
|
|
|
|
+++ systemd-208/src/core/locale-setup.c
|
|
|
|
@@ -73,6 +73,11 @@ int locale_setup(char ***environment) {
|
|
|
|
char **add;
|
2013-04-23 11:39:56 +02:00
|
|
|
char *variables[_VARIABLE_MAX] = {};
|
|
|
|
int r = 0, i;
|
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
|
|
|
+ char _cleanup_free_ *root_uses_lang;
|
|
|
|
+
|
|
|
|
+ zero(root_uses_lang);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (detect_container(NULL) <= 0) {
|
|
|
|
r = parse_env_file("/proc/cmdline", WHITESPACE,
|
2013-10-04 16:07:46 +02:00
|
|
|
@@ -119,6 +124,27 @@ int locale_setup(char ***environment) {
|
2013-08-02 07:26:48 +02:00
|
|
|
if (r < 0 && r != -ENOENT)
|
2013-04-23 11:39:56 +02:00
|
|
|
log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
|
|
|
|
}
|
|
|
|
+#ifdef HAVE_SYSV_COMPAT
|
2013-10-04 16:07:46 +02:00
|
|
|
+ if (r <= 0 &&
|
2013-04-23 11:39:56 +02:00
|
|
|
+ (r = parse_env_file("/etc/sysconfig/language", NEWLINE,
|
|
|
|
+ "ROOT_USES_LANG", &root_uses_lang,
|
|
|
|
+ "RC_LANG", &variables[VARIABLE_LANG],
|
2013-08-02 07:26:48 +02:00
|
|
|
+ NULL)) < 0) {
|
|
|
|
+ if (r != -ENOENT)
|
|
|
|
+ log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
|
2013-04-23 11:39:56 +02:00
|
|
|
+
|
|
|
|
+ } else {
|
2013-08-02 07:26:48 +02:00
|
|
|
+ if (!root_uses_lang || (root_uses_lang && !strcaseeq(root_uses_lang,"yes"))) {
|
|
|
|
+ if (root_uses_lang && strcaseeq(root_uses_lang,"ctype"))
|
|
|
|
+ variables[VARIABLE_LC_CTYPE]=variables[VARIABLE_LANG];
|
|
|
|
+ else
|
|
|
|
+ free(variables[VARIABLE_LANG]);
|
2013-04-23 11:39:56 +02:00
|
|
|
+
|
2013-08-02 07:26:48 +02:00
|
|
|
+ variables[VARIABLE_LANG]=strdup("POSIX");
|
2013-04-23 11:39:56 +02:00
|
|
|
+ }
|
2013-08-02 07:26:48 +02:00
|
|
|
+ }
|
2013-04-23 11:39:56 +02:00
|
|
|
+
|
|
|
|
+#endif
|
2013-08-02 07:26:48 +02:00
|
|
|
|
2013-10-04 16:07:46 +02:00
|
|
|
add = NULL;
|
2013-08-02 07:26:48 +02:00
|
|
|
for (i = 0; i < _VARIABLE_MAX; i++) {
|