Compare commits

..

3 Commits
epel9 ... epel8

@ -1,44 +0,0 @@
From fd88080637e019fdca3e9412e470b073d4f282b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Mon, 14 Jun 2021 19:49:22 +0200
Subject: [PATCH] Replace the obsolete get_event_loop with get_running_loop
---
python-pkg/lirc/async_client.py | 2 +-
python-pkg/tests/test_client.py | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/python-pkg/lirc/async_client.py b/python-pkg/lirc/async_client.py
index 1affce68..f3586b0f 100644
--- a/python-pkg/lirc/async_client.py
+++ b/python-pkg/lirc/async_client.py
@@ -63,7 +63,7 @@ class AsyncConnection(object):
self._conn = connection
self._loop = loop
- self._queue = asyncio.Queue(loop=self._loop)
+ self._queue = asyncio.Queue()
self._loop.add_reader(self._conn.fileno(), read_from_fd)
def close(self):
diff --git a/python-pkg/tests/test_client.py b/python-pkg/tests/test_client.py
index d9af254d..7c1fb9fa 100644
--- a/python-pkg/tests/test_client.py
+++ b/python-pkg/tests/test_client.py
@@ -106,7 +106,12 @@ class ReceiveTests(unittest.TestCase):
stdout = subprocess.PIPE,
stderr = subprocess.STDOUT) as child:
_wait_for_socket()
- loop = asyncio.get_event_loop()
+
+ try:
+ loop = asyncio.get_running_loop()
+ except RuntimeError:
+ loop = asyncio.new_event_loop()
+
with LircdConnection('foo',
socket_path=_SOCKET,
lircrc_path='lircrc.conf') as conn:
--
2.31.1

@ -1,78 +0,0 @@
From bb6a390633f32942ac10f9b7b7fc01dfbd395a48 Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@nowhere.net>
Date: Fri, 21 Jan 2022 14:00:54 +0100
Subject: [PATCH] database.py: Handle new PyYAML interface.
---
python-pkg/lirc/database.py | 12 ++++++++----
tools/check_configs.py | 4 ++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/python-pkg/lirc/database.py b/python-pkg/lirc/database.py
index d464c2ab..d1f42c64 100644
--- a/python-pkg/lirc/database.py
+++ b/python-pkg/lirc/database.py
@@ -44,6 +44,10 @@ import sys
try:
import yaml
+ try:
+ from yaml import CLoader as Loader, CDumper as Dumper
+ except ImportError:
+ from yaml import Loader, Dumper
except ImportError:
_YAML_MSG = '''
"Cannot import the yaml library. Please install the python3
@@ -66,7 +70,7 @@ def _load_kerneldrivers(configdir):
'''
with open(os.path.join(configdir, "kernel-drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader = Loader)
drivers = cf['drivers'].copy()
for driver in cf['drivers']:
if driver == 'default':
@@ -132,14 +136,14 @@ class Database(object):
yamlpath = configdir
db = {}
with open(os.path.join(yamlpath, "confs_by_driver.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader = Loader)
db['lircd_by_driver'] = cf['lircd_by_driver'].copy()
db['lircmd_by_driver'] = cf['lircmd_by_driver'].copy()
db['kernel-drivers'] = _load_kerneldrivers(configdir)
db['drivers'] = db['kernel-drivers'].copy()
with open(os.path.join(yamlpath, "drivers.yaml")) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader = Loader)
db['drivers'].update(cf['drivers'].copy())
for key, d in db['drivers'].items():
d['id'] = key
@@ -158,7 +162,7 @@ class Database(object):
configs = {}
for path in glob.glob(configdir + '/*.conf'):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader = Loader)
configs[cf['config']['id']] = cf['config']
db['configs'] = configs
self.db = db
diff --git a/tools/check_configs.py b/tools/check_configs.py
index 1e0d831b..5e458de7 100755
--- a/tools/check_configs.py
+++ b/tools/check_configs.py
@@ -4,6 +4,10 @@
import glob
import yaml
+try:
+ from yaml import CLoader as Loader, CDumper as Dumper
+except ImportError:
+ from yaml import Loader, Dumper
def main():
configs = {}
--
2.34.1

@ -1,5 +1,6 @@
# This package depends on automagic byte compilation
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2
%global _python_bytecompile_extra 1
%global _hardened_build 1
%global __python %{__python3}
@ -9,7 +10,7 @@
Name: lirc
Version: 0.10.0
Release: 36%{?tag:.}%{?tag}%{?dist}
Release: 19%{?tag:.}%{?tag}%{?dist}
Summary: The Linux Infrared Remote Control package
%global repo http://downloads.sourceforge.net/lirc/LIRC/%{version}
@ -26,8 +27,6 @@ Patch2: 0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch
Patch3: 0003-plugins-devinput-fix-glob-no-match-error.patch
Patch5: 0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch
Patch6: 0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch
Patch7: 0001-Replace-the-obsolete-get_event_loop-with-get_running.patch
Patch8: 0007-database.py-Handle-new-PyYAML-interface.patch
BuildRequires: gcc-c++
@ -42,13 +41,8 @@ BuildRequires: kernel-headers
BuildRequires: man2html-core
BuildRequires: libftdi-devel
BuildRequires: libtool
%if (0%{?fedora} && 0%{?fedora} < 37) || (0%{?rhel} && 0%{?rhel} < 10)
BuildRequires: libusb-devel
%else
BuildRequires: libusb-compat-0.1-devel
%endif
BuildRequires: libusb1-devel
BuildRequires: libxslt
BuildRequires: libXt-devel
BuildRequires: portaudio-devel
@ -57,11 +51,8 @@ BuildRequires: python%{python3_pkgversion}-PyYAML
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: socat
BuildRequires: systemd-devel
BuildRequires: make
Requires: %{name}-libs = %{version}-%{release}
Requires: lockdev
Suggests: xorg-x11-misc-fonts
Requires(pre): shadow-utils
Requires(post): systemd
@ -234,7 +225,6 @@ sed -i -e 's|/usr/local/etc/|/etc/|' contrib/irman2lirc
%build
autoreconf -fi
export PYTHON=/usr/bin/python3
%configure \
--docdir="%{_pkgdocdir}" \
@ -271,7 +261,7 @@ install -Dpm 644 %{SOURCE2} \
cp -a %{SOURCE1} README.fedora
mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir}
echo "d %{_rundir}/lirc 0755 lirc lirc -" \
echo "d /var/run/lirc 0755 lirc lirc -" \
> $RPM_BUILD_ROOT%{_tmpfilesdir}/lirc.conf
@ -394,59 +384,6 @@ systemd-tmpfiles --create %{_tmpfilesdir}/lirc.conf
%{_udevrulesdir}/99-remote-control-lirc.rules
%changelog
* Thu Jun 16 2022 Python Maint <python-maint@redhat.com> - 0.10.0-36
- Rebuilt for Python 3.11
* Thu Jun 16 2022 Alec Leamas <leamas.alec@nowhere.net> - 0.10.0-35
- Handle libusb-devel -> libus-compat-0.1-devel
* Fri Jan 21 2022 Alec Leamas <leamas.alec@nowhere.net> - 0.10.0-34
- Add patch for revised PyYAML interface. Closes: #2034939
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.10.0-31
- Rebuilt for Python 3.10
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.10.0-30
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Nov 03 2020 Alec Leamas <leamas.alec@nowhere.nt> - 0.10.0-28
- Add R: lockdev. Closes: #1839223.
* Mon Oct 26 2020 Alec Leamas <leamas.alec@nowhere.nt> - 0.10.0-27
- Fix python bytecompile FTBFS error.
* Mon Oct 26 2020 Alec Leamas <leamas.alec@nowhere.nt> - 0.10.0-26
- Fix python version FTFBS error.
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-25
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-23
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Paul Wouters <pwouters@redhat.com> - 0.10.0-22
- Use rundir macro and not old hardcoded /var/run for tmpfile creation in spec file.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-20
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Wed Aug 21 2019 Alec Leamas <leamas.alec@gmail.com> - 0.10.0-19
- Fix FTBS on python 3.8. Closes: #1718285.
- mode2: Fix inconsistent loglevel/debug option (upstream #307)

Loading…
Cancel
Save