diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-12-29 14:00:07 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-01-01 19:41:36 +0100 |
commit | 03475e2232d655e9a1c584080ca4ed592b1bd623 (patch) | |
tree | d2d80222cc8d6c3d672df956eba329dd83c771b3 /tools | |
parent | Make default locale a compile time option (diff) | |
download | systemd-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-x | tools/choose-default-locale.sh | 12 |
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 |