From: Zack Cerza Date: Tue, 17 Mar 2026 20:32:38 +0000 (-0600) Subject: bootstrap: Support nonstandard locales X-Git-Tag: 1.3.0~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2158%2Fhead;p=teuthology.git bootstrap: Support nonstandard locales Some newer systems use e.g. LANG=C.utf8, which is breaking bootstrap since it expects to see e.g. C.utf-8. Instead of trying to parse the values, simply split on '.' and append 'utf-8'. Signed-off-by: Zack Cerza --- diff --git a/bootstrap b/bootstrap index 8990d8781..56c451ef1 100755 --- a/bootstrap +++ b/bootstrap @@ -106,9 +106,11 @@ if [ -f "$VENV/pyvenv.cfg" ]; then sed -i'' -e 's/\(include-system-site-packages\s*=\s*\)true/\1false/g' $VENV/pyvenv.cfg fi -# Attempt to force a UTF-8 locale without being specific to English -export LANG=${LANG:-C.UTF-8} -(echo $LANG | grep -qi utf-8) || export LC_ALL=$LANG.UTF-8 +# Attempt to force a UTF-8 locale without forcing English +LANG=${LANG:=C} +LC_ALL=${LC_ALL:=C} +export LANG="${LANG/.*/}.utf-8" +export LC_ALL="${LC_ALL/.*/}.utf-8" if [ -z "$NO_CLOBBER" ] && \ [ ! -e "$VENV/bin/pip" -o ! -e "$VENV/bin/$PYTHON" ] || \