[OE-core] [PATCH 1/7] license.bbclass: Introduce AVAILABLE_LICENSES that lists all licenses

Quentin Schulz quentin.schulz at streamunlimited.com
Mon Dec 9 09:40:30 UTC 2019


Hi Peter,

On Sat, Dec 07, 2019 at 06:38:09AM +0100, Peter Kjellerstedt wrote:
> Previously, there was SRC_DISTRIBUTE_LICENSES, an undocumented
> variable that contained a static list of licenses. It was used by
> expand_wildcard_licenses() to expand any wildcards used in, e.g.,
> INCOMPATIBLE_LICENSE. However, since this static list of licenses has
> not been kept up-to-date, many licenses were missing, with the result
> that if one tried to use any of those licenses with a wildcard, no
> licenses would be found, effectively ignoring that they should be
> marked as incompatible.
> 
> This introduces a new (documented) variable, AVAILABLE_LICENSES, that
> is automatically updated to contain all licenses found in any
> directories specified by ${COMMON_LICENSE_DIR} and ${LICENSE_PATH},
> and uses it instead of SRC_DISTRIBUTE_LICENSES when expanding
> wildcards.
> 

Great addition, thanks!

> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
> ---
>  meta/classes/license.bbclass                  | 27 ++++++++++++++++---
>  meta/conf/documentation.conf                  |  1 +
>  .../oeqa/selftest/cases/incompatible_lic.py   |  6 ++---
>  3 files changed, 27 insertions(+), 7 deletions(-)
> 
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index 648a4d7892..20af6d34b6 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -252,7 +252,7 @@ def canonical_license(d, license):
>      """
>      Return the canonical (SPDX) form of the license if available (so GPLv3
>      becomes GPL-3.0), for the license named 'X+', return canonical form of
> -    'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+), 
> +    'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+),

Might not be fully awake yet but looks like it's a spurious change here.
Though, there's actually a typo in availabel that could be fixed :)

[...]
>  
>      # Verify that a package with a non-SPDX license (neither in
> -    # SRC_DISTRIBUTE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
> +    # AVAILABLE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
>      # INCOMPATIBLE_LICENSE contains this license
>      def test_incompatible_nonspdx_license(self):
>          self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense')
> -- 

I think it could be great to have a new test in that selftest file to check that
INCOMPATIBLE_LICENSE works with wildcards for licenses not in
SRC_DISTRIBUTE_LICENSES.

Thanks,
Quentin


More information about the Openembedded-core mailing list