Skip to content

Commit

Permalink
upgpkg: salt 3005.1-2: new patch for importlib issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxboron committed Jan 30, 2023
1 parent fbf1d71 commit 045bd14
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
7 changes: 4 additions & 3 deletions salt/.SRCINFO
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
pkgbase = salt
pkgdesc = Central system and configuration manager
pkgver = 3005.1
pkgrel = 1
pkgrel = 2
url = http://saltstack.org/
install = salt.install
arch = any
license = Apache
makedepends = python-setuptools
depends = python-jinja
depends = python-msgpack
depends = python-yaml
Expand All @@ -27,10 +28,10 @@ pkgbase = salt
backup = etc/salt/master
backup = etc/salt/minion
source = https://pypi.io/packages/source/s/salt/salt-3005.1.tar.gz
source = fix-entrypoint.patch::https://github.com/saltstack/salt/commit/b676e6338a7c094cb3335d11f851ac0e12222017.patch
source = salt-importlib.patch
source = salt.logrotate
sha256sums = fa14c5d873f863b50950121d7e23a2449502745490c7c48c0cf045406cfe57c1
sha256sums = 219f23ddd44003c8572201495834cf8d84967b182d29157fa3ce73270785b7ab
sha256sums = 10703afd392e2af87cd06bdb6bcc3322c44825ef57cdc6e67d47a53b72514623
sha256sums = abecc3c1be124c4afffaaeb3ba32b60dfee8ba6dc32189edfa2ad154ecb7a215

pkgname = salt
9 changes: 5 additions & 4 deletions salt/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

pkgname=salt
pkgver=3005.1
pkgrel=1
pkgrel=2
pkgdesc='Central system and configuration manager'
arch=('any')
url='http://saltstack.org/'
Expand All @@ -25,6 +25,7 @@ depends=('python-jinja'
'python-distro'
'python-importlib-metadata'
'python-pycryptodomex')
makedepends=('python-setuptools')
optdepends=('dmidecode: decode SMBIOS/DMI tables'
'python-pygit2: gitfs support')
#checkdepends=('python-pytest' 'python-psutil')
Expand All @@ -33,10 +34,10 @@ backup=('etc/logrotate.d/salt'
'etc/salt/minion')
install=salt.install
source=("https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz"
"fix-entrypoint.patch::https://github.com/saltstack/salt/commit/b676e6338a7c094cb3335d11f851ac0e12222017.patch"
"salt-importlib.patch"
salt.logrotate)
sha256sums=('fa14c5d873f863b50950121d7e23a2449502745490c7c48c0cf045406cfe57c1'
'219f23ddd44003c8572201495834cf8d84967b182d29157fa3ce73270785b7ab'
'10703afd392e2af87cd06bdb6bcc3322c44825ef57cdc6e67d47a53b72514623'
'abecc3c1be124c4afffaaeb3ba32b60dfee8ba6dc32189edfa2ad154ecb7a215')

prepare() {
Expand All @@ -48,7 +49,7 @@ prepare() {
# so pyzmq<=20.0.0 ends up in the final requirements.txt
echo -e '-r crypto.txt\n\npyzmq' > requirements/zeromq.txt

patch -Np1 < "$srcdir/fix-entrypoint.patch"
patch -Np1 < "$srcdir/salt-importlib.patch"
}

build() {
Expand Down
29 changes: 29 additions & 0 deletions salt/salt-importlib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/salt/utils/entrypoints.py b/salt/utils/entrypoints.py
index 3effa0b494..9452878ade 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:
+ try:
+ 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)
+ except AttributeError:
+ # importlib-metadata<5.0.0
+ 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:
+ continue
+ entry_points_listing.append(entry_point)

return entry_points_listing

0 comments on commit 045bd14

Please sign in to comment.