summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-12-29 14:00:07 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-01-01 19:41:36 +0100
commit03475e2232d655e9a1c584080ca4ed592b1bd623 (patch)
treed2d80222cc8d6c3d672df956eba329dd83c771b3 /tools
parentMake default locale a compile time option (diff)
downloadsystemd-03475e2232d655e9a1c584080ca4ed592b1bd623.tar.xz
systemd-03475e2232d655e9a1c584080ca4ed592b1bd623.zip
meson: check whether C.UTF-8 exists or not and use it if exists
If C.UTF-8 does not exist, then fallback to en_US.UTF-8 or C.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/choose-default-locale.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/choose-default-locale.sh b/tools/choose-default-locale.sh
new file mode 100755
index 0000000000..43087980a9
--- /dev/null
+++ b/tools/choose-default-locale.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+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