Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dlibs: make define_for_kernel work with kernels in any order
An undocumented requirement of define_for_kernel (and thus expand_for_kernel) is that when multiple kernel versions are specified, they must be in ascending order. This is because __process_element does not stop searching for an expansion when one is found, and doesn't check to see if each expansion it finds is more suitable than any it already knows about: so if you list an expansion for 5.11.0 followed by one for 4.10.0, and build it against 5.11.6, __process_element will conclude (correctly) that 5.11.0 matches, mark it as found, then keep scanning, conclude that 4.10.0 matches too, and overwrite the already-found match, even though 5.11.0 is a better match for 5.11.6 than 4.10.0 is. This is easy to fix: in addition to remembering the found match, remember what version it matched against, and only overwrite matches if the potential match has a higher version number. Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information