commit 582b6dfb13269ad43793d66ef47454b19ced7f25
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Tue Nov 5 14:05:57 2019 +0000
Fix F32 issue
fix_deprecated.patch | 37 +++++++++++++++++++++++++++++++++++++
rfpkg.spec | 12 +++++++++++-
2 files changed, 48 insertions(+), 1 deletion(-)
---
diff --git a/fix_deprecated.patch b/fix_deprecated.patch
new file mode 100644
index 0000000..e3b9a3e
--- /dev/null
+++ b/fix_deprecated.patch
@@ -0,0 +1,37 @@
+--- a/rfpkg/__init__.py
++++ b/rfpkg/__init__.py
+@@ -262,28 +262,18 @@ class Commands(pyrpkg.Commands):
+ """Need to know what the runtime env is, so we can unset
anything
+ conflicting
+ """
+-
+ try:
+- mydist = platform.linux_distribution()
+- except:
+- # This is marked as eventually being deprecated.
+- try:
+- mydist = platform.dist()
+- except:
+- runtime_os = 'unknown'
+- runtime_version = '0'
+-
+- if mydist:
+- runtime_os = mydist[0]
+- runtime_version = mydist[1]
+- else:
+- runtime_os = 'unknown'
+- runtime_version = '0'
++ runtime_os, runtime_version, _ = linux_distribution()
++ except Exception:
++ return None
+
+ if runtime_os in ['redhat', 'centos']:
+ return 'el%s' % runtime_version
+ if runtime_os == 'Fedora':
+ return 'fc%s' % runtime_version
++ if (runtime_os == 'Red Hat Enterprise Linux Server' or
++ runtime_os.startswith('CentOS')):
++ return 'el{0}'.format(runtime_version.split('.')[0])
+
+ # fall through, return None
+ return None
diff --git a/rfpkg.spec b/rfpkg.spec
index 62df361..a3e8ca1 100644
--- a/rfpkg.spec
+++ b/rfpkg.spec
@@ -5,12 +5,16 @@
Name: rfpkg
Version: 1.26.2
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: RPM Fusion utility for working with dist-git
License: GPLv2+
Group: Applications/System
URL:
https://github.com/rpmfusion-infra/rfpkg
Source0: %url/archive/v%{version}/%{name}-%{version}.tar.gz
+# Fix error in F32
+# if mydist:
+# UnboundLocalError: local variable 'mydist' referenced before assignment
+Patch0: fix_deprecated.patch
BuildArch: noarch
@@ -80,6 +84,9 @@ RPM Fusion utility for working with dist-git.
%prep
%setup -q
+%if 0%{?fedora} > 31
+%patch0 -p1
+%endif
%build
%if %{with python2}
@@ -137,6 +144,9 @@ nosetests
%changelog
+* Tue Nov 05 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.26.2-3
+- Fix F32 issue
+
* Sat Oct 12 2019 Sérgio Basto <sergio(a)serjux.com> - 1.26.2-2
- Fixup buildrequires and use correct python macros