On 2/27/24 17:41, Alexander Kanavin wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

Wait. Why is the correct locale not generated? How do other systems do
it? There's an issue elsewhere, possibly in glibc-locale, and this
works around that, instead of fixing the original problem.

Hi Alex,


Since SHIFTJIS is not a ISO2022/posix compliant and not in the list of glibc locale data support, it was generated by manual with localedef and don't have a unified name.


The following name has been already found on different linux:

ja_JP.SJIS ja_JP.SHIFT_JIS ja_JP.shiftjis japanese.sjis


Br,

Xiangyu



Alex

On Tue, 27 Feb 2024 at 09:57, Xiangyu Chen
<xiangyu.c...@eng.windriver.com> wrote:
From: Xiangyu Chen <xiangyu.c...@windriver.com>

Bash has a test case that needs ja_JP shift jis locale.

It will check current system has ja_JP.SJIS locale or not, but in yocto,
this locale named ja_JP.shiftjis, they are the same.
So create a locale alias, making ja_JP.SJIS link to ja_JP.shiftjis.

Also add warning message if current system doesn't contain shift jis locale.

Signed-off-by: Xiangyu Chen <xiangyu.c...@windriver.com>
---
  meta/recipes-extended/bash/bash/run-ptest | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

diff --git a/meta/recipes-extended/bash/bash/run-ptest 
b/meta/recipes-extended/bash/bash/run-ptest
index 738ad3c42c..3cafb5e2ea 100644
--- a/meta/recipes-extended/bash/bash/run-ptest
+++ b/meta/recipes-extended/bash/bash/run-ptest
@@ -3,6 +3,7 @@
  en_US=`locale -a | grep en_US*`
  fr_FR=`locale -a | grep fr_FR*`
  de_DE=`locale -a | grep de_DE*`
+ja_JP_SJIS=`locale -a | grep ja_JP.shiftjis`

  if [ -z "$en_US" ]
  then
@@ -19,8 +20,28 @@ then
          echo "Warning: The de_DE* locales is needed to run the intl.tests, please 
add it."
  fi

+if [ -z "$ja_JP_SJIS" ]
+then
+        echo "Warning: The ja_JP.shiftjis locales is needed to run the intl.tests, 
please add it."
+else
+# Yocto generated shiftjis locale named ja_JP.shiftjis, but bash's test script 
using ja_JP.SJIS
+# They are the same one, so add an alias in locale.alias
+        if [ -f /usr/share/locale/locale.alias ]
+        then
+                cp /usr/share/locale/locale.alias 
/usr/share/locale/locale.alias.bak
+        fi
+
+        echo "ja_JP.SJIS        ja_JP.shiftjis" >> 
/usr/share/locale/locale.alias
+fi
+
+
  useradd bashtest
  chown -R bashtest:bashtest tests
  setpriv --reuid bashtest --rgid bashtest --clear-groups --reset-env $(dirname 
"$0")/run-bash-ptests
  chown -R root:root tests
  userdel -r bashtest
+
+if [ -f /usr/share/locale/locale.alias.bak ]
+then
+        mv /usr/share/locale/locale.alias.bak /usr/share/locale/locale.alias
+fi
--
2.34.1




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#196320): 
https://lists.openembedded.org/g/openembedded-core/message/196320
Mute This Topic: https://lists.openembedded.org/mt/104599698/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to