]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Switch default-locale default to C.UTF-8
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 3 Jun 2022 11:29:47 +0000 (13:29 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 3 Jun 2022 20:08:37 +0000 (05:08 +0900)
We're already using C.UTF-8 as the default locale for nspawn. Let's
make the same change for the default-locale option instead of deciding
what to use based on the locale used by the host system. Users can
still override the locale using the default-locale option if needed.

meson.build
meson_options.txt
tools/choose-default-locale.sh [deleted file]

index 04b90c97a9200a7bcb3b3d8bc59bbcb4bd9660cd..dc3cc7f8b64b4c38dffd0f585b9e2c94b2e8a350 100644 (file)
@@ -929,15 +929,6 @@ ntp_servers = get_option('ntp-servers')
 conf.set_quoted('NTP_SERVERS', ntp_servers)
 
 default_locale = get_option('default-locale')
-if default_locale == ''
-        if not meson.is_cross_build()
-                choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
-                default_locale = run_command(choose_default_locale_sh,
-                                             check : true).stdout().strip()
-        else
-                default_locale = 'C.UTF-8'
-        endif
-endif
 conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
 
 localegen_path = get_option('localegen-path')
index 26d1170c5046c295d9a2ff4e25a76e0f06da4837..6c816abd65d19543385c7cdb2a70e265d4fdb86f 100644 (file)
@@ -300,7 +300,7 @@ option('default-kill-user-processes', type : 'boolean',
        description : 'the default value for KillUserProcesses= setting')
 option('gshadow', type : 'boolean',
        description : 'support for shadow group')
-option('default-locale', type : 'string', value : '',
+option('default-locale', type : 'string', value : 'C.UTF-8',
        description : 'default locale used when /etc/locale.conf does not exist')
 option('localegen-path', type : 'string', value : '',
        description : 'absolute path to the locale-gen binary in case the system is using locale-gen')
diff --git a/tools/choose-default-locale.sh b/tools/choose-default-locale.sh
deleted file mode 100755 (executable)
index a5158cf..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -e
-
-# Fedora uses C.utf8 but Debian uses C.UTF-8
-if locale -a | grep -xq -E 'C\.(utf8|UTF-8)'; then
-    echo 'C.UTF-8'
-elif locale -a | grep -xqF 'en_US.utf8'; then
-    echo 'en_US.UTF-8'
-else
-    echo 'C'
-fi