]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.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>
Sat, 7 Oct 2017 22:20:39 +0000 (23:20 +0100)
commit16f1a14f83353b809650ce5fe50b35e38b6c6d7e
treeda594c3ffd5d88960efe82dc2977f1bbb7dd5ec5
parent03839a7ffa395edaf85e74a86799a44b217b79d3
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().

(From OE-Core rev: 312b4d6175e189852c0787ca2fe99b99ce92d1bd)

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