| # SPDX-License-Identifier: GPL-2.0-only |
| def is_optional(feature, d): |
| return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional")) |
| def packages(features, d): |
| packages = d.getVar("FEATURE_PACKAGES_%s" % feature) |
| for pkg in (packages or "").split(): |
| def required_packages(features, d): |
| req = [feature for feature in features if not is_optional(feature, d)] |
| def optional_packages(features, d): |
| opt = [feature for feature in features if is_optional(feature, d)] |
| def active_packages(features, d): |
| return itertools.chain(required_packages(features, d), |
| optional_packages(features, d)) |
| def active_recipes(features, d): |
| for pkg in active_packages(features, d): |
| recipe = oe.packagedata.recipename(pkg, d) |