On Mon, Apr 11, 2022 at 9:14 AM Christopher Larson via
lists.openembedded.org <[email protected]> wrote:
> 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(+)
>
> diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> index 0c637e966e..db8c3f8584 100644
> --- a/meta/classes/license.bbclass
> +++ b/meta/classes/license.bbclass
> @@ -320,6 +320,43 @@ def incompatible_license(d, dont_want_licenses,
> package=None):
>
> return incompatible_pkg_license(d, dont_want_licenses, license)
>
> +def any_incompatible(d, packages, licensestring=None):
> + """Return True if any of the 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 ''}"
> + """
> + if not isinstance(packages, str):
> + packages = packages.split()
>
If it's not a string, I split it? Oops :) v2 forthcoming.
--
Christopher Larson
[email protected], [email protected], [email protected]
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
Industries Software
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164331):
https://lists.openembedded.org/g/openembedded-core/message/164331
Mute This Topic: https://lists.openembedded.org/mt/90398685/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-