itzg / mc-image-helper

This tool does the complicated bits for the itzg/minecraft-server image
MIT License
59 stars 26 forks source link

Support old-fashioned patches #446

Open paradox460 opened 4 months ago

paradox460 commented 4 months ago

The PatchSet and PatchDefinition systems have many advantages to traditional patches, but one shortcoming is they can't work with plain text files. Some mods use plain text to store things like MOTDs, and it would be nice to patch in a reliable way. I've been using interpolation where appropriate, but it's not ideal.

Having the ability to use .patch files, as used by the unix patch command, would be extremely useful. While these are more fragile than the path-based system, they also have the ability to do far more variety of changes

paradox460 commented 4 months ago

This would make the changes I'm attempting in #445 absolutely trivial, for example

itzg commented 4 months ago

Yeah, the current patching is just a best effort implementation using the library that was already in use for JSON processing. Generic patch file support makes sense to include as an option.

I'd be happy for a sensible PR for this since I probably won't be able to get to this for quite some time.