summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2022-04-18 10:33:24 -0700
committerPatrick McLean <chutzpah@gentoo.org>2022-04-18 10:33:53 -0700
commitf46615977e1e24ca348fffdc81d1011dfdf0b4d0 (patch)
tree9acfcbb3bb8484af6227025a8e00d65011a678bf /app-admin
parentdev-util/bcc: 0.24.0-r1 drop py3.7, add LLVM 14 support (diff)
downloadgentoo-f46615977e1e24ca348fffdc81d1011dfdf0b4d0.tar.gz
gentoo-f46615977e1e24ca348fffdc81d1011dfdf0b4d0.tar.bz2
gentoo-f46615977e1e24ca348fffdc81d1011dfdf0b4d0.zip
app-admin/salt: Revbump, fix probly with py319 (bug #839276)
Closes: https://bugs.gentoo.org/839276 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/salt/files/salt-3004.1-py310.patch53
-rw-r--r--app-admin/salt/salt-3004.1-r3.ebuild (renamed from app-admin/salt/salt-3004.1-r2.ebuild)1
2 files changed, 54 insertions, 0 deletions
diff --git a/app-admin/salt/files/salt-3004.1-py310.patch b/app-admin/salt/files/salt-3004.1-py310.patch
new file mode 100644
index 000000000000..7e30d7687a66
--- /dev/null
+++ b/app-admin/salt/files/salt-3004.1-py310.patch
@@ -0,0 +1,53 @@
+From a58bbbe058df8f45872c43a95992f6a7a7914ab9 Mon Sep 17 00:00:00 2001
+From: piterpunk <piterpunk@slackware.com>
+Date: Fri, 15 Oct 2021 11:03:20 -0300
+Subject: [PATCH] Fix _compat.py importlib logic for Python 3.10
+
+Use the same logic in _compat.py and entrypoints.py to load
+the same importlib.metadata. Python's built in implementation for
+Python >= 3.10 and the Salt one for others.
+---
+ salt/_compat.py | 30 +++++++++++++++++-------------
+ 1 file changed, 17 insertions(+), 13 deletions(-)
+
+diff --git a/salt/_compat.py b/salt/_compat.py
+index 8149657bea61..a402f17a3c71 100644
+--- a/salt/_compat.py
++++ b/salt/_compat.py
+@@ -11,19 +11,23 @@
+ else:
+ import salt.ext.ipaddress as ipaddress
+
++if sys.version_info >= (3, 10):
++ # Python 3.10 will include a fix in importlib.metadata which allows us to
++ # get the distribution of a loaded entry-point
++ import importlib.metadata # pylint: disable=no-member,no-name-in-module
++else:
++ # importlib_metadata before version 3.3.0 does not include the functionality we need.
++ try:
++ import importlib_metadata
+
+-# importlib_metadata before version 3.3.0 does not include the functionality we need.
+-try:
+- import importlib_metadata
+-
+- importlib_metadata_version = [
+- int(part)
+- for part in importlib_metadata.version("importlib_metadata").split(".")
+- if part.isdigit()
+- ]
+- if tuple(importlib_metadata_version) < (3, 3, 0):
++ importlib_metadata_version = [
++ int(part)
++ for part in importlib_metadata.version("importlib_metadata").split(".")
++ if part.isdigit()
++ ]
++ if tuple(importlib_metadata_version) < (3, 3, 0):
++ # Use the vendored importlib_metadata
++ import salt.ext.importlib_metadata as importlib_metadata
++ except ImportError:
+ # Use the vendored importlib_metadata
+ import salt.ext.importlib_metadata as importlib_metadata
+-except ImportError:
+- # Use the vendored importlib_metadata
+- import salt.ext.importlib_metadata as importlib_metadata
diff --git a/app-admin/salt/salt-3004.1-r2.ebuild b/app-admin/salt/salt-3004.1-r3.ebuild
index 38244a2fee60..d7ded011cd0a 100644
--- a/app-admin/salt/salt-3004.1-r2.ebuild
+++ b/app-admin/salt/salt-3004.1-r3.ebuild
@@ -110,6 +110,7 @@ PATCHES=(
"${FILESDIR}/salt-3004.1-jinja-3.patch"
"${FILESDIR}/salt-3004.1-tests.patch"
"${FILESDIR}/salt-3004.1-relax-pyzmq-dep.patch"
+ "${FILESDIR}/salt-3004.1-py310.patch"
)
python_prepare_all() {