jhawthorn / pub_grub

🍔 A ruby implementation of the PubGrub CDCL-based version solver
MIT License
151 stars 11 forks source link

Respect root notion of custom package classes #15

Closed deivid-rodriguez closed 1 year ago

deivid-rodriguez commented 1 year ago

If a pub grub user implements its own package class, it may have its own notion of root package. As a matter of fact, PubGrub's solver can receive a custom root package (falling back to its own internal Package.root).

However, when internally checking whether a package is the root package, PubGrub was always hardcoding the comparison to its own Package.root.

This PR tries to give more flexibility here by allowing custom package classes to define a #root? method, and respect that during solving, while trying to keep backwards compatibility with existing package classes that don't implement this.

jhawthorn commented 1 year ago

Sorry for the slow response, I was on vacation (not quite for the last 10 days, but enough it's an excuse 😅). I've sent you an invite on GitHub so I'm not a blocker going forward.

deivid-rodriguez commented 1 year ago

No worries, you didn't take long at all and it didn't block anything :).

Thanks for the invitation!