I am about to convert old keymap files to the new hwdb format but entries like | pci:v1131p7160* | KEYBOARD_KEY_160001=power | KEYBOARD_KEY_160018=mute | | KEYBOARD_KEY_160003=kp1 get rejected by '/sbin/udevadm hwdb --update --root=../../..' with | Error, MATCH expected but got ' KEYBOARD_KEY_160003=kp1' in ... Replacing empty lines (which splits basically function blocks or rows of the remote control) with comments does not help. As this is a complex ruleset defining >100 keys, I need some markup/documentation in the file so that I do not lose overview. Things worked fine with old keymap files. Tested with systemd-208
That's just the very basic rules of the file format, a feature and expected behavior. \n is the record separator, only leading whitespace declares continuation lines. Try inserting a comment line starting with '#'. If you want/need more fancy comment placements, just change the parser and send a patch; but we cannot just allow completely empty lines in records, that wouldn't be valid any more.
comments do not work: | pci:v1131p7160* | KEYBOARD_KEY_160001=power | # row 1 | KEYBOARD_KEY_160003=kp1 $ /sbin/udevadm hwdb --update --root=. Error, MATCH expected but got ' KEYBOARD_KEY_160003=kp1' in './etc/udev/hwdb.d/x.hwdb':
They do, don't indent them. As said, if you need more fancy comment stuff, send a patch for the parser.
Would it be acceptable to treat empty lines as non-entry-terminating if the first following non-empty line is indented? This would follow Python style a bit. I think this would be nicer than forcing fake comments, especially that those comments cannot be indented, which makes the whole thing awkward for long lists.
The records are kind of rfc0822-style, which wouldn't allow that. We should allow indented '#' lines, so they align naturally. But I'm not sure if we really should allow one record to be split up and have newlines in it. It kind of looks invalid from the general rules what a record is.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.