]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
bootstrap: Support nonstandard locales 2158/head
authorZack Cerza <zack@cerza.org>
Tue, 17 Mar 2026 20:32:38 +0000 (14:32 -0600)
committerZack Cerza <zack@cerza.org>
Tue, 17 Mar 2026 20:32:38 +0000 (14:32 -0600)
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 <zack@cerza.org>
bootstrap

index 8990d878191d24b3976a2edf68866f3fa1c360d6..56c451ef1bf2b6f58623e64d2b80d80cb02bc4b1 100755 (executable)
--- 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" ] || \