diff options
Diffstat (limited to 'recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch')
-rw-r--r-- | recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch b/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch deleted file mode 100644 index f1d8235..0000000 --- a/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | From 70602601ac1cfc4399430ef8609b96fc224d1e25 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vit Mojzis <vmojzis@redhat.com> | ||
3 | Date: Fri, 24 Jun 2022 16:24:25 +0200 | ||
4 | Subject: [PATCH] gettext: handle unsupported languages properly | ||
5 | |||
6 | With "fallback=True" gettext.translation behaves the same as | ||
7 | gettext.install and uses NullTranslations in case the | ||
8 | translation file for given language was not found (as opposed to | ||
9 | throwing an exception). | ||
10 | |||
11 | Fixes: | ||
12 | # LANG is set to any "unsupported" language, e.g. en_US.UTF-8 | ||
13 | $ chcat --help | ||
14 | Traceback (most recent call last): | ||
15 | File "/usr/bin/chcat", line 39, in <module> | ||
16 | t = gettext.translation(PROGNAME, | ||
17 | File "/usr/lib64/python3.9/gettext.py", line 592, in translation | ||
18 | raise FileNotFoundError(ENOENT, | ||
19 | FileNotFoundError: [Errno 2] No translation file found for domain: 'selinux-python' | ||
20 | |||
21 | Signed-off-by: Vit Mojzis <vmojzis@redhat.com> | ||
22 | Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com> | ||
23 | Acked-by: Petr Lautrbach <plautrba@redhat.com> | ||
24 | |||
25 | Upstream-Status: Backport | ||
26 | [https://github.com/SELinuxProject/selinux/commit/344463076b2a91e1d2c7f5cc3835dc1a53a05e88] | ||
27 | |||
28 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
29 | --- | ||
30 | sandbox | 3 ++- | ||
31 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
32 | |||
33 | diff --git a/sandbox b/sandbox | ||
34 | index cd5709f..789621e 100644 | ||
35 | --- a/sandbox | ||
36 | +++ b/sandbox | ||
37 | @@ -45,7 +45,8 @@ try: | ||
38 | kwargs['unicode'] = True | ||
39 | t = gettext.translation(PROGNAME, | ||
40 | localedir="/usr/share/locale", | ||
41 | - **kwargs) | ||
42 | + **kwargs, | ||
43 | + fallback=True) | ||
44 | _ = t.gettext | ||
45 | except: | ||
46 | try: | ||
47 | -- | ||
48 | 2.25.1 | ||
49 | |||