Skip to content

Instantly share code, notes, and snippets.

@xuhcc

xuhcc/salt-py3.patch

Created Jan 22, 2020
Embed
What would you like to do?
From f3581557cf8e800511c6996252b364a618b8be00 Mon Sep 17 00:00:00 2001
From: Kirill Goncharov <kdgoncharov@gmail.com>
Date: Wed, 22 Jan 2020 18:22:16 +0300
Subject: [PATCH] Add python3.8 patch for salt-ssh
---
0001-saltssh-py38.patch | 25 +++++++++++++++++++++++++
PKGBUILD | 11 +++++++++--
2 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 0001-saltssh-py38.patch
diff --git a/0001-saltssh-py38.patch b/0001-saltssh-py38.patch
new file mode 100644
index 0000000..da1ec11
--- /dev/null
+++ b/0001-saltssh-py38.patch
@@ -0,0 +1,25 @@
+index a3be0b8a1c..ff548923f4 100644
+--- "a/salt/grains/core.py"
++++ "b/salt/grains/core.py"
+@@ -35,12 +35,6 @@ except ImportError:
+ __proxyenabled__ = ['*']
+ __FQDN__ = None
+
+-# Extend the default list of supported distros. This will be used for the
+-# /etc/DISTRO-release checking that is part of linux_distribution()
+-from platform import _supported_dists
+-_supported_dists += ('arch', 'mageia', 'meego', 'vmware', 'bluewhite64',
+- 'slamd64', 'ovs', 'system', 'mint', 'oracle', 'void')
+-
+ # linux_distribution deprecated in py3.7
+ try:
+ from platform import linux_distribution as _deprecated_linux_distribution
+@@ -1939,7 +1933,7 @@ def os_data():
+ )
+ (osname, osrelease, oscodename) = \
+ [x.strip('"').strip("'") for x in
+- linux_distribution(supported_dists=_supported_dists)]
++ linux_distribution()]
+ # Try to assign these three names based on the lsb info, they tend to
+ # be more accurate than what python gets from /etc/DISTRO-release.
+ # It's worth noting that Ubuntu has patched their Python distribution
diff --git a/PKGBUILD b/PKGBUILD
index 03ebce1..61b9ac4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,10 +36,17 @@ backup=('etc/logrotate.d/salt'
install=salt.install
source=("https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz"
- salt.logrotate)
+ salt.logrotate
+ "0001-saltssh-py38.patch")
sha256sums=('7497e7dbfd4dc3799bbbc8da63da98b8301bbb644150f3905fe5775a7d81271a'
- 'abecc3c1be124c4afffaaeb3ba32b60dfee8ba6dc32189edfa2ad154ecb7a215')
+ 'abecc3c1be124c4afffaaeb3ba32b60dfee8ba6dc32189edfa2ad154ecb7a215'
+ 'e91791b6431ba56ff5ba0b0ff4ae1fba7335fa358698e12829daf2c248c1568d')
+
+prepare() {
+ cd salt-$pkgver
+ patch -p1 < ../0001-saltssh-py38.patch
+}
build() {
cd salt-$pkgver
--
2.25.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.