SHA256
1
0
forked from pool/systemd
systemd/handle-root_uses_lang-value-in-etc-sysconfig-language.patch
Dominique Leuenberger 70c63e98f9 Accepting request 286653 from Base:System
- mark more subpackages as !bootstrap for systemd-mini usage.

- spec : remove --with-firmware-path, firmware loader was removed in v217
- spec: remove --disable-multi-seat-x, gone.(fixed in xorg)
- spec: Do not enable systemd-readahead-collect.service and
systemd-readahead-replay.service as these do not exist anymore.
- spec: drop timedate-add-support-for-openSUSE-version-of-etc-sysconfig.patch
  Yast was fixed to write all timezone changes exactly how timedated expects
  things to be done.
- spec: remove handle-etc-HOSTNAME.patch, since late 2014 the netcfg
  package handles the migration from /etc/HOSTNAME to /etc/hostname
  and owns both files.
-spec: remove boot.udev and systemd-journald.init as they currently
  serve no purpose.
- suse-sysv-bootd-support.diff: Remove HAVE_SYSVINIT conditions, we
   are in sysvcompat-only codepath, also remove the code targetting other
   distributions, never compiled as the TARGET_$DISTRO macros are never defined.
- systemd-powerd-initctl-support.patch guard with HAVE_SYSV_COMPAT
- set-and-use-default-logconsole.patch: fix HAVE_SYSV_COMPAT guards
- insserv-generator.patch: Only build when sysvcompat is enabled
- vhangup-on-all-consoles.patch add a comment indicating this is a workaround
  for a kernel bug.
- spec: Add option to allow disabling sysvinit compat at build time.
- spec: Add option to enable resolved at build time.
- spec: Remove all %ifs for !factory products, current systemd releases can
  neither be built nor installed in older products without upgrading
  several components of the base system. 
  (removed: 1008-add-msft-compability-rules.patch was only for =< 13.1)
- spec: remove all dummy "aliases" to /etc/init.d, that made sense only when
  those init scripts still existed. (dummy localfs.service source: gone)

OBS-URL: https://build.opensuse.org/request/show/286653
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=215
2015-03-01 13:49:19 +00:00

54 lines
2.0 KiB
Diff

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 | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
Index: systemd-218/src/core/locale-setup.c
===================================================================
--- systemd-218.orig/src/core/locale-setup.c
+++ systemd-218/src/core/locale-setup.c
@@ -36,6 +36,11 @@ int locale_setup(char ***environment) {
char **add;
char *variables[_VARIABLE_LC_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,
@@ -82,6 +87,27 @@ int locale_setup(char ***environment) {
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
}
+#ifdef HAVE_SYSV_COMPAT
+ if (r <= 0 &&
+ (r = parse_env_file("/etc/sysconfig/language", NEWLINE,
+ "ROOT_USES_LANG", &root_uses_lang,
+ "RC_LANG", &variables[VARIABLE_LANG],
+ NULL)) < 0) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
+
+ } else {
+ 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]);
+
+ variables[VARIABLE_LANG]=strdup("POSIX");
+ }
+ }
+
+#endif
add = NULL;
for (i = 0; i < _VARIABLE_LC_MAX; i++) {