diff --git a/lirc.changes b/lirc.changes index f7b76e6..541f2e3 100644 --- a/lirc.changes +++ b/lirc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 24 13:00:26 UTC 2021 - Matej Cepl + +- 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 diff --git a/lirc.spec b/lirc.spec index 7827966..c5724a2 100644 --- a/lirc.spec +++ b/lirc.spec @@ -36,6 +36,9 @@ 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 diff --git a/pyyaml-60-compatibility.patch b/pyyaml-60-compatibility.patch new file mode 100644 index 0000000..439ce8d --- /dev/null +++ b/pyyaml-60-compatibility.patch @@ -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']