Closed cottsay closed 2 years ago
At some point we should consider to use a proper parser to avoid the custom code here
I agree. I couldn't find a viable alternative at this point. python-debian
doesn't appear to give us any functionality for parsing and filtering the individual elements. The best way I could find was to use mk-build-deps
to generate a dependency metapackage and then using dpkg
to list the dependencies of that package, and filter out the "built-in" ones. Eventually I deemed manual parsing to be a less fragile approach than the two process invocations necessary to make that happen.
Suggestions would be nice, but I agree that it's probably out of scope for what we're doing here.
Thanks for the review.
Previous behavior is to ignore a version-based exclusion and break if any arch or profile exclusions are present. This change parses all of those exclusions and specifically adds proper support for the 'nocheck' build profile.
Given some documentation, it should be easy to add architecture exclusion support as well.
The implementation here builds on the existing approach, which works backward from the end of the string looking for exclusion markers. A regular expression for each class would probably also work here.