Skip to contentSkip to conversation

license: add 'any_incompatible' function

PATCH Christopher Larson 1 participant 1 message Apr 13, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
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 ''}"

---
 meta/classes/license.bbclass | 37 ++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
meta/classes/license.bbclass +0 -0
index 0c637e966e..db8c3f8584 100644
@@ -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 incompatible

license.

meta/classes/license.bbclass +2 -0
+
+    License exceptions are obeyed. The user may specify the package's

license

meta/classes/license.bbclass +3 -0
+    for cross-recipe checks.
+
+    This allows for additions to packagegroups only for non-incompatible

builds.

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