From 357a4ee6809c251eb0f517209f92494341058b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 23 May 2023 14:17:20 +0100 Subject: [PATCH] Add patch for py3.10 support (RHBZ#2189782) --- ...e6338a7c094cb3335d11f851ac0e12222017.patch | 40 +++++++++++++++++++ salt.spec | 8 +++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 b676e6338a7c094cb3335d11f851ac0e12222017.patch diff --git a/b676e6338a7c094cb3335d11f851ac0e12222017.patch b/b676e6338a7c094cb3335d11f851ac0e12222017.patch new file mode 100644 index 0000000..7eca30d --- /dev/null +++ b/b676e6338a7c094cb3335d11f851ac0e12222017.patch @@ -0,0 +1,40 @@ +From b676e6338a7c094cb3335d11f851ac0e12222017 Mon Sep 17 00:00:00 2001 +From: MKLeb +Date: Wed, 5 Oct 2022 15:49:37 -0400 +Subject: [PATCH] Allow entrypoint compatibility for importlib-metadata>=5.0.0 + +--- + salt/utils/entrypoints.py | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +diff --git a/salt/utils/entrypoints.py b/salt/utils/entrypoints.py +index 3effa0b4941..ac65ae2df49 100644 +--- a/salt/utils/entrypoints.py ++++ b/salt/utils/entrypoints.py +@@ -38,13 +38,20 @@ def iter_entry_points(group, name=None): + entry_points_listing = [] + entry_points = importlib_metadata.entry_points() + +- for entry_point_group, entry_points_list in entry_points.items(): +- if entry_point_group != group: +- continue +- for entry_point in entry_points_list: +- if name is not None and entry_point.name != name: ++ # pre importlib-metadata 5.0.0 ++ if hasattr(entry_points, "items"): ++ for entry_point_group, entry_points_list in entry_points.items(): ++ if entry_point_group != group: + continue +- entry_points_listing.append(entry_point) ++ for entry_point in entry_points_list: ++ if name is not None and entry_point.name != name: ++ continue ++ entry_points_listing.append(entry_point) ++ # starting with importlib-metadata 5.0.0 ++ for entry_point in entry_points.select(group=group): ++ if name is not None and entry_point.name != name: ++ continue ++ entry_points_listing.append(entry_point) + + return entry_points_listing + diff --git a/salt.spec b/salt.spec index 4707e0c..77fd4ea 100644 --- a/salt.spec +++ b/salt.spec @@ -11,7 +11,7 @@ Name: salt Version: 3005.1%{?__rc_ver} -Release: 3%{?dist} +Release: 4%{?dist} Summary: A parallel remote execution system Group: System Environment/Daemons License: ASL 2.0 @@ -40,6 +40,9 @@ Source20: %{name}-run.fish Source21: %{name}-syndic.fish Patch0: contextvars.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2189782 +# salt-3005.1-entry-points-py310.patch +Patch1: https://github.com/saltstack/salt/commit/b676e6338a7c094cb3335d11f851ac0e12222017.patch BuildArch: noarch %ifarch %{ix86} x86_64 @@ -317,6 +320,9 @@ install -p -m 0644 pkg/%{name}.zsh %{buildroot}%{zsh_dir}/_%{name} %changelog +* Mon May 22 2023 Jonathan Steffan - 3005.1-4 +- Add patch for py3.10 support (RHBZ#2189782) + * Sat Jan 21 2023 Fedora Release Engineering - 3005.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild