Summary: | hwdb: fails on empty lines/comments in hwdb files | ||
---|---|---|---|
Product: | systemd | Reporter: | Enrico Scholz <bugs-freedesktop> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED NOTABUG | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Enrico Scholz
2014-01-04 01:34:13 UTC
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.