From 9cf54adcb1d9973c0f567b129e24a854c92f6e9c Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Wed, 21 Aug 2019 22:13:12 +0200 Subject: [PATCH] 0.10.0-19 --- ...ins-devinput-fix-glob-no-match-error.patch | 38 +++++++++++++++++++ ...consistent-loglevel-debug-option-307.patch | 25 ++++++++++++ ...-use-deprecated-time.clock-RHBZ-1718.patch | 30 +++++++++++++++ lirc.spec | 12 +++++- 4 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 0003-plugins-devinput-fix-glob-no-match-error.patch create mode 100644 0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch create mode 100644 0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch diff --git a/0003-plugins-devinput-fix-glob-no-match-error.patch b/0003-plugins-devinput-fix-glob-no-match-error.patch new file mode 100644 index 0000000..ebcd758 --- /dev/null +++ b/0003-plugins-devinput-fix-glob-no-match-error.patch @@ -0,0 +1,38 @@ +From 14685b280fde85a6e801f7fb7d5e579b2ddb3581 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Fri, 28 Jul 2017 18:07:50 +0200 +Subject: [PATCH 3/6] plugins: devinput: fix glob "no match" error + +See 63e041cc5 and LIRC issue #285 (Debian: #860551) +--- + plugins/devinput.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/plugins/devinput.c b/plugins/devinput.c +index 846a0b70..d4d733a0 100644 +--- a/plugins/devinput.c ++++ b/plugins/devinput.c +@@ -247,15 +247,15 @@ static int locate_default_device(char* errmsg, size_t size) + + r = glob("/sys/class/rc/rc0/input[0-9]*/event[0-9]*", + 0, NULL, &matches); +- if (r != 0) { +- log_perror_warn("Cannot run glob %s", DEV_PATTERN); ++ if (r == GLOB_NOMATCH) { ++ strncpy(errmsg, "No /sys/class/rc/ devices found", size - 1); + log_notice("No input device available for devinput driver." + " Consider stopping lircd.socket or reconfigure lirc"); +- snprintf(errmsg, size, "Cannot glob %s", DEV_PATTERN); + return 0; + } +- if (matches.gl_pathc == 0) { +- strncpy(errmsg, "No /sys/class/rc/ devices found", size - 1); ++ if (r != 0) { ++ log_perror_warn("Cannot run glob %s", DEV_PATTERN); ++ snprintf(errmsg, size, "Cannot glob %s", DEV_PATTERN); + return 0; + } + if (matches.gl_pathc > 1) { +-- +2.20.1 + diff --git a/0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch b/0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch new file mode 100644 index 0000000..4f0f742 --- /dev/null +++ b/0005-mode2-Fix-inconsistent-loglevel-debug-option-307.patch @@ -0,0 +1,25 @@ +From aa2b06cff01b52666e44aae59ee56fc9092cad93 Mon Sep 17 00:00:00 2001 +From: Alec Leamas +Date: Sun, 3 Sep 2017 04:21:57 +0200 +Subject: [PATCH 5/6] mode2: Fix inconsistent loglevel/debug option (#307). + +--- + tools/mode2.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/mode2.cpp b/tools/mode2.cpp +index fe578f89..e962610d 100644 +--- a/tools/mode2.cpp ++++ b/tools/mode2.cpp +@@ -74,7 +74,7 @@ static const char* const help = + + static const struct option options[] = { + {"help", no_argument, NULL, 'h'}, +- {"debug", required_argument, NULL, 'D'}, ++ {"loglevel", required_argument, NULL, 'D'}, + {"version", no_argument, NULL, 'v'}, + {"device", required_argument, NULL, 'd'}, + {"driver", required_argument, NULL, 'H'}, +-- +2.20.1 + diff --git a/0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch b/0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch new file mode 100644 index 0000000..87375f6 --- /dev/null +++ b/0006-python-pkg-Don-t-use-deprecated-time.clock-RHBZ-1718.patch @@ -0,0 +1,30 @@ +From 9d2e0a40294408764710657e78929c83f2fc0f31 Mon Sep 17 00:00:00 2001 +From: Alec Leamas +Date: Wed, 21 Aug 2019 21:48:25 +0200 +Subject: [PATCH 6/6] python-pkg: Don't use deprecated time.clock() (RHBZ + #1718285) + +--- + python-pkg/lirc/client.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python-pkg/lirc/client.py b/python-pkg/lirc/client.py +index 7e069a55..482913cf 100644 +--- a/python-pkg/lirc/client.py ++++ b/python-pkg/lirc/client.py +@@ -219,10 +219,10 @@ class RawConnection(AbstractConnection): + def readline(self, timeout: float = None) -> str: + ''' Implements AbstractConnection.readline(). ''' + if timeout: +- start = time.clock() ++ start = time.perf_counter() + while b'\n' not in self._buffer: + ready = self._select.select( +- start + timeout - time.clock() if timeout else timeout) ++ start + timeout - time.perf_counter() if timeout else timeout) + if ready == []: + if timeout: + raise TimeoutException( +-- +2.20.1 + diff --git a/lirc.spec b/lirc.spec index 5db8c3e..9f87fb6 100644 --- a/lirc.spec +++ b/lirc.spec @@ -10,7 +10,7 @@ Name: lirc Version: 0.10.0 -Release: 18%{?tag:.}%{?tag}%{?dist} +Release: 19%{?tag:.}%{?tag}%{?dist} Summary: The Linux Infrared Remote Control package %global repo http://downloads.sourceforge.net/lirc/LIRC/%{version} @@ -24,6 +24,9 @@ Source1: README.fedora Source2: 99-remote-control-lirc.rules Patch1: 0001-build-install-media-lirc.h-BTS-872074.patch 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 BuildRequires: gcc-c++ @@ -209,7 +212,7 @@ See http://www.ftdichip.com. %prep -%autosetup -n %{name}-%{version}%{?tag:-}%{?tag} +%autosetup -p1 -n %{name}-%{version}%{?tag:-}%{?tag} sed -i -e 's/#effective-user/effective-user /' lirc_options.conf sed -i -e '/^effective-user/s/=$/= lirc/' lirc_options.conf sed -i '/User=/s/; *//' systemd/lircd.service @@ -381,6 +384,11 @@ systemd-tmpfiles --create %{_tmpfilesdir}/lirc.conf %{_udevrulesdir}/99-remote-control-lirc.rules %changelog +* Wed Aug 21 2019 Alec Leamas - 0.10.0-19 +- Fix FTBS on python 3.8. Closes: #1718285. +- mode2: Fix inconsistent loglevel/debug option (upstream #307) +- plugins: devinput: fix glob "no match" error (upstream #285, DBS 860551) + * Mon Aug 19 2019 Miro HronĨok - 0.10.0-18 - Rebuilt for Python 3.8