diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2023-03-11 21:13:04 +0800 |
|---|---|---|
| committer | Joe MacDonald <joe@deserted.net> | 2023-03-27 09:34:02 -0400 |
| commit | ff424dc4cfb6e214df1f17ef549aa809bcbac13e (patch) | |
| tree | 14fa8b8549cf67864cca83a2c13fd7c3dbc9d61d /recipes-security/selinux/selinux-python | |
| parent | 1f4cefc8821f88627db3c3630cf0f5c7c643bfc1 (diff) | |
| download | meta-selinux-ff424dc4cfb6e214df1f17ef549aa809bcbac13e.tar.gz | |
selinux-python: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.
* Refresh patch.
* Drop backport patch.
* Add dependency python3-setuptools-scm-native to fix build error.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
Diffstat (limited to 'recipes-security/selinux/selinux-python')
| -rw-r--r-- | recipes-security/selinux/selinux-python/0001-gettext-handle-unsupported-languages-properly.patch | 173 | ||||
| -rw-r--r-- | recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch | 8 |
2 files changed, 4 insertions, 177 deletions
diff --git a/recipes-security/selinux/selinux-python/0001-gettext-handle-unsupported-languages-properly.patch b/recipes-security/selinux/selinux-python/0001-gettext-handle-unsupported-languages-properly.patch deleted file mode 100644 index b83300d..0000000 --- a/recipes-security/selinux/selinux-python/0001-gettext-handle-unsupported-languages-properly.patch +++ /dev/null | |||
| @@ -1,173 +0,0 @@ | |||
| 1 | From 4693794ff8c52f87a4abdb68fe9dae6618023c03 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 | chcat/chcat | 5 +++-- | ||
| 31 | semanage/semanage | 3 ++- | ||
| 32 | semanage/seobject.py | 3 ++- | ||
| 33 | sepolgen/src/sepolgen/sepolgeni18n.py | 4 +++- | ||
| 34 | sepolicy/sepolicy.py | 3 ++- | ||
| 35 | sepolicy/sepolicy/__init__.py | 3 ++- | ||
| 36 | sepolicy/sepolicy/generate.py | 3 ++- | ||
| 37 | sepolicy/sepolicy/gui.py | 3 ++- | ||
| 38 | sepolicy/sepolicy/interface.py | 3 ++- | ||
| 39 | 9 files changed, 20 insertions(+), 10 deletions(-) | ||
| 40 | |||
| 41 | diff --git a/chcat/chcat b/chcat/chcat | ||
| 42 | index e779fcc..952cb81 100755 | ||
| 43 | --- a/chcat/chcat | ||
| 44 | +++ b/chcat/chcat | ||
| 45 | @@ -38,9 +38,10 @@ try: | ||
| 46 | kwargs['unicode'] = True | ||
| 47 | t = gettext.translation(PROGNAME, | ||
| 48 | localedir="/usr/share/locale", | ||
| 49 | - **kwargs) | ||
| 50 | + **kwargs, | ||
| 51 | + fallback=True) | ||
| 52 | _ = t.gettext | ||
| 53 | -except ImportError: | ||
| 54 | +except: | ||
| 55 | try: | ||
| 56 | import builtins | ||
| 57 | builtins.__dict__['_'] = str | ||
| 58 | diff --git a/semanage/semanage b/semanage/semanage | ||
| 59 | index 8f4e44a..f45061a 100644 | ||
| 60 | --- a/semanage/semanage | ||
| 61 | +++ b/semanage/semanage | ||
| 62 | @@ -38,7 +38,8 @@ try: | ||
| 63 | kwargs['unicode'] = True | ||
| 64 | t = gettext.translation(PROGNAME, | ||
| 65 | localedir="/usr/share/locale", | ||
| 66 | - **kwargs) | ||
| 67 | + **kwargs, | ||
| 68 | + fallback=True) | ||
| 69 | _ = t.gettext | ||
| 70 | except: | ||
| 71 | try: | ||
| 72 | diff --git a/semanage/seobject.py b/semanage/seobject.py | ||
| 73 | index ff8f4e9..0782c08 100644 | ||
| 74 | --- a/semanage/seobject.py | ||
| 75 | +++ b/semanage/seobject.py | ||
| 76 | @@ -42,7 +42,8 @@ try: | ||
| 77 | kwargs['unicode'] = True | ||
| 78 | t = gettext.translation(PROGNAME, | ||
| 79 | localedir="/usr/share/locale", | ||
| 80 | - **kwargs) | ||
| 81 | + **kwargs, | ||
| 82 | + fallback=True) | ||
| 83 | _ = t.gettext | ||
| 84 | except: | ||
| 85 | try: | ||
| 86 | diff --git a/sepolgen/src/sepolgen/sepolgeni18n.py b/sepolgen/src/sepolgen/sepolgeni18n.py | ||
| 87 | index 56ebd80..1ff307d 100644 | ||
| 88 | --- a/sepolgen/src/sepolgen/sepolgeni18n.py | ||
| 89 | +++ b/sepolgen/src/sepolgen/sepolgeni18n.py | ||
| 90 | @@ -19,7 +19,9 @@ | ||
| 91 | |||
| 92 | try: | ||
| 93 | import gettext | ||
| 94 | - t = gettext.translation( 'selinux-python' ) | ||
| 95 | + t = gettext.translation("selinux-python", | ||
| 96 | + localedir="/usr/share/locale", | ||
| 97 | + fallback=True) | ||
| 98 | _ = t.gettext | ||
| 99 | except: | ||
| 100 | def _(str): | ||
| 101 | diff --git a/sepolicy/sepolicy.py b/sepolicy/sepolicy.py | ||
| 102 | index 7ebe0ef..c7a70e0 100755 | ||
| 103 | --- a/sepolicy/sepolicy.py | ||
| 104 | +++ b/sepolicy/sepolicy.py | ||
| 105 | @@ -36,7 +36,8 @@ try: | ||
| 106 | kwargs['unicode'] = True | ||
| 107 | t = gettext.translation(PROGNAME, | ||
| 108 | localedir="/usr/share/locale", | ||
| 109 | - **kwargs) | ||
| 110 | + **kwargs, | ||
| 111 | + fallback=True) | ||
| 112 | _ = t.gettext | ||
| 113 | except: | ||
| 114 | try: | ||
| 115 | diff --git a/sepolicy/sepolicy/__init__.py b/sepolicy/sepolicy/__init__.py | ||
| 116 | index 7208234..9c3caa0 100644 | ||
| 117 | --- a/sepolicy/sepolicy/__init__.py | ||
| 118 | +++ b/sepolicy/sepolicy/__init__.py | ||
| 119 | @@ -31,7 +31,8 @@ try: | ||
| 120 | kwargs['unicode'] = True | ||
| 121 | t = gettext.translation(PROGNAME, | ||
| 122 | localedir="/usr/share/locale", | ||
| 123 | - **kwargs) | ||
| 124 | + **kwargs, | ||
| 125 | + fallback=True) | ||
| 126 | _ = t.gettext | ||
| 127 | except: | ||
| 128 | try: | ||
| 129 | diff --git a/sepolicy/sepolicy/generate.py b/sepolicy/sepolicy/generate.py | ||
| 130 | index 67189fc..3717d5d 100644 | ||
| 131 | --- a/sepolicy/sepolicy/generate.py | ||
| 132 | +++ b/sepolicy/sepolicy/generate.py | ||
| 133 | @@ -56,7 +56,8 @@ try: | ||
| 134 | kwargs['unicode'] = True | ||
| 135 | t = gettext.translation(PROGNAME, | ||
| 136 | localedir="/usr/share/locale", | ||
| 137 | - **kwargs) | ||
| 138 | + **kwargs, | ||
| 139 | + fallback=True) | ||
| 140 | _ = t.gettext | ||
| 141 | except: | ||
| 142 | try: | ||
| 143 | diff --git a/sepolicy/sepolicy/gui.py b/sepolicy/sepolicy/gui.py | ||
| 144 | index b026374..5bdbfeb 100644 | ||
| 145 | --- a/sepolicy/sepolicy/gui.py | ||
| 146 | +++ b/sepolicy/sepolicy/gui.py | ||
| 147 | @@ -49,7 +49,8 @@ try: | ||
| 148 | kwargs['unicode'] = True | ||
| 149 | t = gettext.translation(PROGNAME, | ||
| 150 | localedir="/usr/share/locale", | ||
| 151 | - **kwargs) | ||
| 152 | + **kwargs, | ||
| 153 | + fallback=True) | ||
| 154 | _ = t.gettext | ||
| 155 | except: | ||
| 156 | try: | ||
| 157 | diff --git a/sepolicy/sepolicy/interface.py b/sepolicy/sepolicy/interface.py | ||
| 158 | index 599f97f..43f8644 100644 | ||
| 159 | --- a/sepolicy/sepolicy/interface.py | ||
| 160 | +++ b/sepolicy/sepolicy/interface.py | ||
| 161 | @@ -38,7 +38,8 @@ try: | ||
| 162 | kwargs['unicode'] = True | ||
| 163 | t = gettext.translation(PROGNAME, | ||
| 164 | localedir="/usr/share/locale", | ||
| 165 | - **kwargs) | ||
| 166 | + **kwargs, | ||
| 167 | + fallback=True) | ||
| 168 | _ = t.gettext | ||
| 169 | except: | ||
| 170 | try: | ||
| 171 | -- | ||
| 172 | 2.25.1 | ||
| 173 | |||
diff --git a/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch b/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch index bd14450..5eb2e54 100644 --- a/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch +++ b/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From d43220e336edf8ccaaa7bd3eb9c13874ed34d468 Mon Sep 17 00:00:00 2001 | 1 | From 2a0c2489e9d245502e7a9dc5878da01f9d64db2a Mon Sep 17 00:00:00 2001 |
| 2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> | 2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> |
| 3 | Date: Mon, 23 Sep 2013 21:17:59 +0800 | 3 | Date: Mon, 23 Sep 2013 21:17:59 +0800 |
| 4 | Subject: [PATCH] sepolicy: fix install path for new pymodule sepolicy | 4 | Subject: [PATCH] sepolicy: fix install path for new pymodule sepolicy |
| @@ -13,15 +13,15 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | |||
| 13 | 1 file changed, 1 insertion(+), 1 deletion(-) | 13 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 14 | 14 | ||
| 15 | diff --git a/sepolicy/Makefile b/sepolicy/Makefile | 15 | diff --git a/sepolicy/Makefile b/sepolicy/Makefile |
| 16 | index 3361be4..5842321 100644 | 16 | index 4e9e93d..512aab5 100644 |
| 17 | --- a/sepolicy/Makefile | 17 | --- a/sepolicy/Makefile |
| 18 | +++ b/sepolicy/Makefile | 18 | +++ b/sepolicy/Makefile |
| 19 | @@ -27,7 +27,7 @@ test: | 19 | @@ -27,7 +27,7 @@ test: |
| 20 | @$(PYTHON) test_sepolicy.py -v | 20 | @$(PYTHON) test_sepolicy.py -v |
| 21 | 21 | ||
| 22 | install: | 22 | install: |
| 23 | - $(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` $(PYTHON_SETUP_ARGS) | 23 | - $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) . |
| 24 | + $(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) --install-lib=$(PYTHONLIBDIR) --no-compile $(PYTHON_SETUP_ARGS) | 24 | + $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) . |
| 25 | [ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) | 25 | [ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR) |
| 26 | install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy | 26 | install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy |
| 27 | (cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen) | 27 | (cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen) |
