SHA256
1
0
forked from pool/lirc
Dominique Leuenberger 2021-11-26 23:50:57 +00:00 committed by Git OBS Bridge
commit 8b32590755
3 changed files with 68 additions and 10 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Nov 24 13:00:26 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add pyyaml-60-compatibility.patch to make the package
compatible with PyYAML 6.0+ (sht#lirc#365).
-------------------------------------------------------------------
Tue Oct 5 12:06:44 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -32,10 +32,13 @@ URL: http://www.lirc.org/
Source0: https://downloads.sourceforge.net/project/lirc/LIRC/%{version}/lirc-%{version}.tar.bz2
Source1: baselibs.conf
Patch0: reproducible.patch
Patch1: harden_irexec.service.patch
Patch2: harden_lircd-uinput.service.patch
Patch3: harden_lircd.service.patch
Patch4: harden_lircmd.service.patch
Patch1: harden_irexec.service.patch
Patch2: harden_lircd-uinput.service.patch
Patch3: harden_lircd.service.patch
Patch4: harden_lircmd.service.patch
# PATCH-FIX-UPSTREAM pyyaml-60-compatibility.patch sht#lirc#365 mcepl@suse.com
# Makes the package compatible with PyYAML 6.0+
Patch5: pyyaml-60-compatibility.patch
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gobject-introspection
@ -195,15 +198,11 @@ Requires: xorg-x11-fonts-core
Some seldom used X11-based tools for debugging lirc configurations.
%prep
%setup -q
%patch0 -p1
%autosetup -p1
# Don't provide or require anything from _docdir, per policy.
%global __provides_exclude_from ^%{_docdir}/.*$
%global __requires_exclude_from ^%{_docdir}/.*$
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
sed -i -e 's|/usr/local/etc/|%{_sysconfdir}/|' contrib/irman2lirc
sed -i -e 's/#effective-user/effective-user /' lirc_options.conf

View File

@ -0,0 +1,53 @@
---
python-pkg/lirc/database.py | 8 ++++----
tools/check_configs.py | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
--- a/python-pkg/lirc/database.py
+++ b/python-pkg/lirc/database.py
@@ -66,7 +66,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=yaml.Loader)
drivers = cf['drivers'].copy()
for driver in cf['drivers']:
if driver == 'default':
@@ -132,14 +132,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=yaml.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=yaml.Loader)
db['drivers'].update(cf['drivers'].copy())
for key, d in db['drivers'].items():
d['id'] = key
@@ -158,7 +158,7 @@ class Database(object):
configs = {}
for path in sorted(glob.glob(configdir + '/*.conf')):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
configs[cf['config']['id']] = cf['config']
db['configs'] = configs
self.db = db
--- a/tools/check_configs.py
+++ b/tools/check_configs.py
@@ -9,7 +9,7 @@ def main():
configs = {}
for path in glob.glob('*.conf'):
with open(path) as f:
- cf = yaml.load(f.read())
+ cf = yaml.load(f.read(), Loader=yaml.Loader)
if cf['config']['id'] + '.conf' != path:
print( "Id: %s, path: %s" % (cf['config']['id'], path))
configs[cf['config']['id']] = cf['config']