]> code.ossystems Code Review - openembedded-core.git/commit
oe.license: add is_included convenience function
authorChristopher Larson <chris_larson@mentor.com>
Mon, 9 Jan 2012 21:02:34 +0000 (15:02 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 Jan 2012 14:52:59 +0000 (14:52 +0000)
commit7903433898b4683a1c09cc9a6a379421bc9bbd58
tree30cf4e1b2bf03423466887f7b2f230c956caf27a
parent02101bbe08a5cd6e5eecb21f2095c15ebfe9287f
oe.license: add is_included convenience function

Given a license string and whitelist and blacklist, determine if the
license string matches the whitelist and does not match the blacklist.

When encountering an OR, it prefers the side with the highest weight (more
included licenses). It then checks the inclusion of the flattened list of
licenses from there.

Returns a tuple holding the boolean state and a list of the applicable
licenses which were excluded (or None, if the state is True)

Examples:

    is_included, excluded = oe.license.is_included(licensestr, ['GPL*', 'LGPL*'])
    is_included, excluded = oe.license.is_included(licensestr, blacklist=['Proprietary', 'CLOSED'])

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
meta/classes/copyleft_compliance.bbclass
meta/lib/oe/license.py
meta/lib/test.py [new file with mode: 0644]