aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--community/salt/APKBUILD4
-rw-r--r--community/salt/fix-python3.10-importlib_metadata.patch39
2 files changed, 42 insertions, 1 deletions
diff --git a/community/salt/APKBUILD b/community/salt/APKBUILD
index 4ef5111a3c..9a2781f9c5 100644
--- a/community/salt/APKBUILD
+++ b/community/salt/APKBUILD
@@ -4,7 +4,7 @@
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=salt
pkgver=3004
-pkgrel=1
+pkgrel=2
pkgdesc="parallel remote execution system"
url="https://github.com/saltstack/salt"
arch="noarch"
@@ -30,6 +30,7 @@ source="https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz
salt-syndic.confd
salt-syndic.initd
fix-cryptodome-dependency.patch
+ fix-python3.10-importlib_metadata.patch
"
options="!check" # depends on pytestsalt
@@ -172,4 +173,5 @@ cfbbeb8023a383e7c42d84e3346edfd068c9ec7650c4ddc3caa38534da325a67497e1f06ca02cc1f
bafc6ea10cdafd0aef868feb35aecbe4ae6a7dff0ae42862bded85715ad763eb89e1ed27437866a7e5f2b9f7064e3c2a3fb59814487744ba4227238d95cf3818 salt-syndic.confd
d71133e834685304e0167554035ebbc861252f972bbe981cc71e45b70f15d94a28a02a369463c9a641372919689f96b62a0408b14f824ad986d536e52b1e5ec0 salt-syndic.initd
7df577b4a7befc6a37644cbe3e909df29f626f9ccc84d05245c5d2b6a4daeb3ad6bb95b9b3a82de70d50ddc27d15956b016c44c8ad9f878c760d388da86cacbe fix-cryptodome-dependency.patch
+7f32ac9e1fc6a85817f4a99c59b594678a691f9e533ce5dbe9f9edb53471d38f2e7b8c72a9ed0ce09d84bd413639df9e51dc6bd501f7b1622d392839ac8f46a5 fix-python3.10-importlib_metadata.patch
"
diff --git a/community/salt/fix-python3.10-importlib_metadata.patch b/community/salt/fix-python3.10-importlib_metadata.patch
new file mode 100644
index 0000000000..73c427e479
--- /dev/null
+++ b/community/salt/fix-python3.10-importlib_metadata.patch
@@ -0,0 +1,39 @@
+--- 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