summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-12-29 22:00:07 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-01-02 03:41:36 +0900
commit03475e2232d655e9a1c584080ca4ed592b1bd623 (patch)
treed2d80222cc8d6c3d672df956eba329dd83c771b3 /tools
parent8ca9e92c742602b8bcd431001e6f5b78c28c184f (diff)
downloadsystemd-03475e2232d655e9a1c584080ca4ed592b1bd623.tar.gz
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