]> code.ossystems Code Review - openembedded-core.git/commit
license.py: Correct selection of licenses in is_included()
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 29 Sep 2017 15:52:34 +0000 (17:52 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Oct 2017 11:03:33 +0000 (12:03 +0100)
commit312b4d6175e189852c0787ca2fe99b99ce92d1bd
tree74f244d7966571ba173fdc0a0d47ddeaf9af963b
parent50cfc0d7118c747726445a9be7bc4c496dbb8248
license.py: Correct selection of licenses in is_included()

When faced with multiple sets of licenses combined with | (OR), it was
possible for oe.license.is_included() to choose a set of licenses with
a blacklisted license and then report failure, even if choosing
another set of licenses would have resulted in a successful
result. This happened when the chosen set still contained more
whitelisted licenses than the other set.

This change makes sure a set with any blacklisted license is always
considered with a lower weight than a set with only whitelisted
licenses.

Example: Faced with the license string "GPL-3.0 & GPL-2.0 & LGPL-2.1 |
Proprietary" and with "GPL-3.0" being blacklisted, the old code would
report a failure since "GPL-3.0 & GPL-2.0 & LGPL-2.1" still contains
more whitelisted licenses than "Proprietary" does.

This change also adds a unit test for oe.license.is_included().

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oe/license.py
meta/lib/oeqa/selftest/cases/oelib/license.py