1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 10:15:12 +03:00
aports/community/lirc/0009-new-py3-yaml.patch
Brice 067631532a community/lirc: fix missing sysmacros.h header
Add include for `sys/sysmacros.h` to fix references to `major`.

This resolves the error currently seen when attempting to use the default driver:

```
lircd: Error: Error relocating /usr/lib/lirc/plugins/default.so: major: symbol not found
```

Related to the issue here:
https://gitlab.alpinelinux.org/alpine/aports/-/issues/12986
2022-11-25 00:01:14 +01:00

37 lines
1.4 KiB
Diff

--- a/python-pkg/lirc/database.py
+++ b/python-pkg/lirc/database.py
@@ -66,7 +66,7 @@
'''
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 @@
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 @@
configs = {}
for path in 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