Commit Graph

6 Commits

Author SHA1 Message Date
Richard Purdie feeffdb5b6 meta/lib/oe: Replace StandardError with Exception
StandardError is removed in python3, replace with Exception class instead.

(From OE-Core rev: a37ae30b9766df346ca57755530024a0b7d5f86b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 14:06:51 +01:00
Eric Bénard 029f3c6dec license.py: fix behaviour of copyleft_compliance
actually if a package has a license in its LICENSE variable
which is not in the whitelist nor in the blacklist and even
if an other license in this variable is in the whitelist,
the package gets excluded and is not taken in account in the
copyleft_compliance.
This patch solves this by excluding a recipe _only_ if the
LICENSE variable includes a pattern from the blacklist and
including a recipe only if it includes a variable from the
whitelist _and_ none from the blacklist.

Example in busybox which has LICENSE="GPLv2 & BSD-4-Clause",
with the actual behaviour (where he blacklist contains only
CLOSED Proprietary) we get :
DEBUG: copyleft: busybox-1.19.4 is excluded: recipe has excluded licenses: BSD-4-Clause
which is not sane because busybox is covered by a copyleft license
which is GPLv2 and should match the default whitelist which is
GPL* LGPL*.

(From OE-Core rev: 987d06447d2eacf2e01f08e29469c00fbb0ef1db)

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-04 17:17:51 +01:00
Christopher Larson 19247e44a3 oe.license: avoid the need to catch SyntaxError
(From OE-Core rev: cace9ddc0edd654877d968643960fa4343472b58)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:19 +00:00
Christopher Larson 7ce97336aa 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'])

(From OE-Core rev: 7903433898b4683a1c09cc9a6a379421bc9bbd58)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-17 14:53:19 +00:00
Christopher Larson 9fb67f895c oe.license: add license flattening code
This flattens a license tree by selecting one side of each OR operation
(chosen via the user supplied function).

(From OE-Core rev: 6984961314c8ba2aceab9acabb658f96ed249fef)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:29 +00:00
Christopher Larson a57de1ac9d license: split license parsing into oe.license
In addition to moving this functionality to oe.license, makes the string
preparation more picky before passing it off to the ast compilation. This
ensures that LICENSE entries like 'GPL/BSD' are seen as invalid (due to the
presence of the unsupported '/').

(From OE-Core rev: 20d4068045c76e9dc2aff0c152dd02d6a109c9dd)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08 15:24:29 +00:00