Skip to contentSkip to conversation

bash: add sanity check for locale in run-ptest

PATCH New Joe Slater 1 participant 1 message Apr 15, 2019

lore
Share & tools
lore

Joe Slater

author
#0 lore raw

PATCH 1/1 bash: add sanity check for locale in run-ptest

We will fail later if the current locale is invalid, so check for error messages from locale.

---
 meta/recipes-extended/bash/bash/run-ptest | 7 +++++++
 1 file changed, 7 insertions(+)
meta/recipes-extended/bash/bash/run-ptest +7 -0
index c61fabd..19f2991 100644
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if [ -n "`locale -V 2>&1 >/dev/null`" ]
+then
+        echo "The default locale is not valid!"
+        echo "Try 'locale -a' to see installed locales."
+        exit 1
+fi
+
 en_US=`locale -a | grep en_US*`
 fr_FR=`locale -a | grep fr_FR*`
 de_DE=`locale -a | grep de_DE*`
Signature · 1 line
2.7.4