I’ve written a couple PRs, and ultimately closed them all.
At this point, I think it would be reasonable to either:
Import a version comparison library, I found an MIT license header-only one. Being header-only it’s probably better than I can write.
Write a simple string compare. I think I now see the correct algorithm for it. Essentially, start comparing strings from the left in, and exit the loop when there’s a discrepancy.
Some open question about how to handle dpkg special characters.