diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-04-04 14:04:14 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-04-04 14:04:14 -0400 |
commit | e3138283fa5f4c3c2579ee54c8a160fda2c17473 (patch) | |
tree | b90dcbcf3acbf5836bde626e607dca5e956388c1 /tools/Z99-cloud-locale-test.sh | |
parent | 3b69f410718f7d8868b8cbaa04e3969811ee89a9 (diff) | |
download | vyos-cloud-init-e3138283fa5f4c3c2579ee54c8a160fda2c17473.tar.gz vyos-cloud-init-e3138283fa5f4c3c2579ee54c8a160fda2c17473.zip |
locale: list unsupported environment settings in warning
Now if you log in with unsupported locale, you'll see:
The unknown environment variables are:
LC_CTYPE=en_GB.utf-8 LC_MESSAGES=en_GB.utf-8 LC_ALL=en_GB.utf-8
LP: #1558069
Diffstat (limited to 'tools/Z99-cloud-locale-test.sh')
-rwxr-xr-x | tools/Z99-cloud-locale-test.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/Z99-cloud-locale-test.sh b/tools/Z99-cloud-locale-test.sh index 3c51f22d..8e0469ed 100755 --- a/tools/Z99-cloud-locale-test.sh +++ b/tools/Z99-cloud-locale-test.sh @@ -10,7 +10,7 @@ # locale_warn() { - local bad_names="" bad_lcs="" key="" val="" var="" vars="" + local bad_names="" bad_lcs="" key="" val="" var="" vars="" bad_kv="" local w1 w2 w3 w4 remain # if shell is zsh, act like sh only for this function (-L). @@ -37,15 +37,18 @@ locale_warn() { [ "${bad}" = "${var%=*}" ] || continue val=${var#*=} [ "${bad_lcs#* ${val}}" = "${bad_lcs}" ] && - bad_lcs="${bad_lcs} ${val}" + bad_lcs="${bad_lcs} ${val}" + bad_kv="${bad_kv} $bad=$val" break done done bad_lcs=${bad_lcs# } + bad_kv=${bad_kv# } [ -n "$bad_lcs" ] || return 0 printf "_____________________________________________________________________\n" printf "WARNING! Your environment specifies an invalid locale.\n" + printf " The unknown environment variables are:\n %s\n" "$bad_kv" printf " This can affect your user experience significantly, including the\n" printf " ability to manage packages. You may install the locales by running:\n\n" @@ -76,7 +79,7 @@ locale_warn() { printf "\n" fi for bad in ${invalid}; do - printf "WARNING: '${bad}' is an invalid locale\n" + printf "WARNING: '${bad}' is an invalid locale\n" done printf "To see all available language packs, run:\n" |