license: add 'any_incompatible' function
Quoted 44 lines · Christopher Larson via lists.openembedded.org
This function returns True if any of the specified packages are skipped due to
incompatible license.License exceptions are obeyed. The user may specify the package's license for
cross-recipe checks.This allows for additions to packagegroups only for non-incompatible builds. For
example:RDEPENDS_${PN} += "${@'dbench' if not any_incompatible(d, 'dbench','GPL-3.0-only') else ''}"
Signed-off-by Christopher Larson <[email protected]>--- meta/classes/license.bbclass | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)meta/classes/license.bbclass +0
-0@@ -320,6 +320,43 @@ def incompatible_license(d, dont_want_licenses,package=None):
return
incompatible_pkg_license(d, dont_want_licenses, license)meta/classes/license.bbclass +2
-0+def any_incompatible(d, packages, licensestring=None): + """Return True if any of the packages are skipped due to incompatiblelicense.
meta/classes/license.bbclass +2
-0+ + License exceptions are obeyed. The user may specify the package'slicense
meta/classes/license.bbclass +3
-0+ for cross-recipe checks. + + This allows for additions to packagegroups only for non-incompatiblebuilds.
meta/classes/license.bbclass +3
-0+ For example: + + RDEPENDS_${PN} += "${@'dbench' if not any_incompatible(d,'dbench', 'GPL-3.0-only') else ''}"
meta/classes/license.bbclass
Quoted 3 lines
meta/classes/license.bbclass +3
-0+ """ + if not isinstance(packages, str): + packages = packages.split()
If it's not a string, I split it? Oops :) v2 forthcoming.
Signature · 4 lines
Christopher Larson [email protected], [email protected], [email protected] Principal Software Engineer, Embedded Linux Solutions, Siemens Digital Industries Software