[OE-core] [oe-core][PATCH 1/1] bash: add sanity check for locale in run-ptest

Joe Slater joe.slater at windriver.com
Mon Apr 15 23:52:27 UTC 2019


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

Signed-off-by: Joe Slater <joe.slater at windriver.com>
---
 meta/recipes-extended/bash/bash/run-ptest | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/recipes-extended/bash/bash/run-ptest b/meta/recipes-extended/bash/bash/run-ptest
index c61fabd..19f2991 100644
--- a/meta/recipes-extended/bash/bash/run-ptest
+++ b/meta/recipes-extended/bash/bash/run-ptest
@@ -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*`
-- 
2.7.4



More information about the Openembedded-core mailing list