Auto-drop reverse patches
In the event a package is updated to a new release, it would be nice for autospec to automatically remove patches currently applied via the series file if they are reverse patches. This feature would be especially helpful for CVE-fix patches, since new releases will often incorporate those fixes, resulting in one or more reverse patches that should be removed.
Thinking about this idea some more, I'm not sure autospec itself should modify the series file. Maybe more appropriate for an autospec wrapper tool.
I am still reviewing whether this feature is more appropriate for autospec itself or for other tooling wrapping autospec. Regardless, the feature remains in-scope.
I think this is probably something that should go into autospec and could either just be part of a build round or part of tarball (though I'd prefer it just be a failure case we catch).
Maybe could use the work for #608 before doing this though.
Maybe could use the work for #608 before doing this though.
I agree.
I think this is probably something that should go into autospec and could either just be part of a build round or part of tarball (though I'd prefer it just be a failure case we catch).
Thanks for the feedback! Thinking about it more, having this tied to a build round would be pretty straightforward.
Though I still would like avoid modifying the series file... Perhaps we could keep the PatchN: ... in the spec header, and annotate it as auto-dropped, which would influence autospec's parsing of series to skip those patches?
Today autospec modifies options.conf and that is the only config file that it will manipulate based on trying to build. I am not opposed to autospec modifying the series file (with annotations to comment out a patch) and not keeping the PatchN since the package would fail to build if the patch was applied. Also having an incongruity between the spec file does and series file says should be done seems worse to me.
@bryteise Okay, I was mostly concerned about not modifying the series file, but if we want to allow autospec to modify it, then I agree that is the most simple and robust approach to implementing this feature.
I don't really like modifying the config files but I think it is the most correct thing autospec can do for this case at least. Unless we do a series_cache file or something like that which seems worse so I'd prefer to just have autospec handle the reverse patches by touching the series file.
This feature was implemented as an opt-in mechanism with #732.
@bryteise For CVE-fix patches that are backports, should those also have the backport- prefix?
@phmccarty Yes, we'll have to do it that way and just mention in metadata. The CVE as patch name is better for things that aren't getting fixed (or released) by upstream.