kobopatch v0.14.0 is out
kobopatch v0.14.0 mainly consists of a complete rewrite of the kobopatch patch file parsing. It is completely backwards-compatible.
This version will be included in patches v51 later tonight.
Main changes:
- Better error messages:
--- All error messages will include line numbers.
--- Length mismatches show the number of characters.
--- Patches will be applied in a consistent order to make errors easier to fix.
--- All instructions will add their name to error messages.
--- Error checking will be done in stages and will give an error as soon as possible during parsing.
--- Multiple patches in a PatchGroup will mention the other patch.
--- Kobopatch will check for tabs instead of spaces in patch files.
--- Fixed the bug where a whole bunch of hexadecimal gets show on-screen in some cases where a value replacement fails.
- You can now use more than one PatchGroup per patch.
- Checksums of patched files are now recorded in the log file.
Internal changes:
- I've gotten rid of a bunch of old cruft from the transition period.
- I've switched the builds from Travis to Drone (it's faster and more structured).
- I've slightly reduced binary sizes.
- kobopatch is now automatically tested with the patches during builds.
- The patch file logic is now nicely split up instead of being dumped into a big switch statement.
- To add new instructions, you now only need to add 3 lines of code (before you'd have needed to add around 15 scattered everywhere).
- The parsing is a lot more type-safe now.
- I've updated go-yaml to v3, which is what allowed me to do most of the improvements in this rewrite.
For those interested in the internal improvements, compare the instruction implementation(
old,
new), the validation implementation (
old,
new), and some of the parsing (
old,
new).
Error message examples:
old: error applying patch file 'src/libnickel.so.1.0.0.yaml': could not find bytes
new: patch "Freedom to advanced fonts control": line 399: inst 8: ReplaceBytesNOP: could not find bytes
old: i16: replacement string must not be shorter in `Custom reading footer style
new: patch "Custom reading footer style": line 107: inst 16: ReplaceString: replacement string 2 chars too long
old: error applying patch file 'src/libnickel.so.1.0.0.yaml': ReplaceInt: could not find specified bytes at offset ***a bunch of hex which fills your screen ***
new: patch "Custom Sleep/Power-off timeouts": line 512: inst 22: ReplaceInt: could not find specified bytes at offset
old: i21: more than one instruction per bullet in patch `Custom Sleep/Power-off timeouts` (you might be missing a -)
new: instruction 21: line 511: multiple types found in instruction, maybe you forgot a '-'
old: could not parse patch file: error parsing patch file: yaml: line 512: found character that cannot start any token
new: could not parse patch file: patch file contains tabs (it should be indented with spaces, not tabs): yaml: line 512