Update following referenced licenses and rules#5233
Conversation
In case of referenced license files, update the logic to not follow and de-reference licenses when all the license leys in the referenced files are already present in the main license detection. This preserves the license conditions in case there are extra license keys in an expression. Reference: #3523 Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
Signed-off-by: Vincent Gao <gaobing1230@gmail.com>
| # If all the license keys of the referenced license expression already | ||
| # present in the actual license expression | ||
| # note that this preserves AND/OR expressions in the original license | ||
| if referenced_license_keys.issubset(license_keys): |
There was a problem hiding this comment.
This was the main fix btw, this adds another condition when we don't want to follow and replace by referenced license detections. In the case where the referenced license keys is a subset of the original license keys.
For example:
license_expression: (lgpl-2.1 OR mpl-1.1) AND other-permissive
referenced_license_expression: lgpl-2.1 AND mpl-1.1 (from two different files, joined)
|
some tests are failing, i will run them locally and see if its a ci issue or not |
|
I run |
|
Thanks for the review @JonoYang Let me fix the tests, which were failing already before this |
In case of referenced license files, update the logic to not follow and de-reference licenses when all the license leys in the referenced files are already present in the main license detection. This preserves the license conditions in case there are extra license keys in an expression.
References:
Fixes #3523
Tasks
Run tests locally to check for errors.