Notes/Aftermarket

Aftermarket Adds TOML to AfterConfig and Keeps the Vendor Comments

Aftermarket 0.7.0 teaches AfterConfig to read and write TOML, the config format of a lot of newer software. An overlay changes a vendor’s config.toml without ever editing it, and each change can say what value it expects, so an upgrade that moved a default stops apply instead of being overridden.

The point is the output. AfterConfig doesn’t parse the file and write it back out. It edits the lines, so the vendor’s comments, layout and every line the overlay doesn’t name come through byte for byte. Dates stay dates, floats stay floats, and a port written in hex stays hex. In the case study, a diff against the vendor’s file shows seven changed lines and nothing else, and the 1.1 upgrade stops at the two lines where the vendor changed a default itself.

A review before release found six medium problems, among them a value already in place getting rewritten, an unquoted secret showing up in an error message, and a deeply nested file crashing the program. That last one also hit the JSON reader that patch, adapt and record use on request bodies. All were fixed, and the suite now has 444 tests. Binaries are out for Linux, macOS and Windows. The previous note covers AfterGuard.