diff options
author | Frank de Brabander <debrabander@gmail.com> | 2022-12-06 19:18:05 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-04-26 04:03:21 -1000 |
commit | ee5ff08d87a84f957af29bdf96ef232efdb229ae (patch) | |
tree | 48fbf184043fbe74b089ac7ed06def460f8f040e /bitbake/bin | |
parent | fa856e0dac16e13991561882bc6ad4c830674d78 (diff) | |
download | poky-ee5ff08d87a84f957af29bdf96ef232efdb229ae.tar.gz |
bitbake: bin/utils: Ensure locale en_US.UTF-8 is available on the system
Get rid of the duplicate code and add extra check that the
locale en_US.UTF-8 is available on the system. This new helper
method is now located right above the method filter_environment()
which sets LC_ALL environment variable to 'en_US.UTF-8'.
[YOCTO #10165]
(Bitbake rev: 0c6f86b60cfba67c20733516957c0a654eb2b44c)
Signed-off-by: Frank de Brabander <debrabander@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a4ce040a6fd540a1cac52f808f909f9fcf8c961c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 3 | ||||
-rwxr-xr-x | bitbake/bin/bitbake-server | 5 | ||||
-rwxr-xr-x | bitbake/bin/bitbake-worker | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 042c91807d..0b9cc6297c 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -25,8 +25,7 @@ except RuntimeError as exc: | |||
25 | from bb import cookerdata | 25 | from bb import cookerdata |
26 | from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException | 26 | from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException |
27 | 27 | ||
28 | if sys.getfilesystemencoding() != "utf-8": | 28 | bb.utils.check_system_locale() |
29 | sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.") | ||
30 | 29 | ||
31 | __version__ = "2.0.0" | 30 | __version__ = "2.0.0" |
32 | 31 | ||
diff --git a/bitbake/bin/bitbake-server b/bitbake/bin/bitbake-server index f53f88b6b0..d00bb068b8 100755 --- a/bitbake/bin/bitbake-server +++ b/bitbake/bin/bitbake-server | |||
@@ -12,8 +12,9 @@ warnings.simplefilter("default") | |||
12 | import logging | 12 | import logging |
13 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) | 13 | sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib')) |
14 | 14 | ||
15 | if sys.getfilesystemencoding() != "utf-8": | 15 | import bb |
16 | sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.") | 16 | |
17 | bb.utils.check_system_locale() | ||
17 | 18 | ||
18 | # Users shouldn't be running this code directly | 19 | # Users shouldn't be running this code directly |
19 | if len(sys.argv) != 10 or not sys.argv[1].startswith("decafbad"): | 20 | if len(sys.argv) != 10 or not sys.argv[1].startswith("decafbad"): |
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker index 2f3e9f72f9..5e62bc20de 100755 --- a/bitbake/bin/bitbake-worker +++ b/bitbake/bin/bitbake-worker | |||
@@ -24,8 +24,7 @@ import subprocess | |||
24 | from multiprocessing import Lock | 24 | from multiprocessing import Lock |
25 | from threading import Thread | 25 | from threading import Thread |
26 | 26 | ||
27 | if sys.getfilesystemencoding() != "utf-8": | 27 | bb.utils.check_system_locale() |
28 | sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.") | ||
29 | 28 | ||
30 | # Users shouldn't be running this code directly | 29 | # Users shouldn't be running this code directly |
31 | if len(sys.argv) != 2 or not sys.argv[1].startswith("decafbad"): | 30 | if len(sys.argv) != 2 or not sys.argv[1].startswith("decafbad"): |