diff mbox series

[blacksail,49/60] populate_sdk_ext: Fix locale error handling in SDK

Message ID 028ff91bf4bb2e96ddf8d1aa7c1ed1f603c994d5.1793867929.git.yoann.congal@smile.fr
State RFC, archived
Delegated to: Yoann Congal
Headers show
Series [blacksail,01/60] gstreamer1.0-plugins-bad: use gtk+3 dependency name | expand

Commit Message

Yoann Congal Nov. 5, 2026, 8:43 a.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

During automated testing we occasionally we see the error:

"ERROR: the installer requires the en_US.UTF-8 locale to be installed (but not selected), please install it first"

This is puzzling as the locale *is* installed. The use of -q with grep in
a pipeline is potentially problematic as grep can exit early and cause a
pipefail/SIGPIPE.

Tweak the code to avoid it and a few other issues (add quoting, handle the
"." correctly, match a whole line).

[YOCTO #16198]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f290e76eef3bd175f71414b7f78aafd0af5e0ce2)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 meta/classes-recipe/populate_sdk_ext.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass
index a1188da9697..00b41ec0cbf 100644
--- a/meta/classes-recipe/populate_sdk_ext.bbclass
+++ b/meta/classes-recipe/populate_sdk_ext.bbclass
@@ -678,7 +678,7 @@  sdk_ext_preinst() {
 	fi
         # Check setting of LC_ALL set above
 	canonicalised_locale=`echo $LC_ALL | sed 's/UTF-8/utf8/'`
-	if ! locale -a | grep -q $canonicalised_locale ; then
+	if ! locale -a | grep -Fx "$canonicalised_locale" > /dev/null ; then
 		echo "ERROR: the installer requires the $LC_ALL locale to be installed (but not selected), please install it first"
 		exit 1
 	fi