From d14090ab7309936b0b84f7056094a1df40064d9e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 6 Mar 2014 16:46:10 +0000 Subject: Rename PACKAGE_GROUP variable to FEATURE_PACKAGES Since tasks were renamed to packagegroups some time ago, this variable name implies that its usage is necessarily related to them which is not the case. Rename the variable to more closely represent what it does (whilst still providing backwards-compatibility with a warning for PACKAGE_GROUP). (From OE-Core rev: d703e07ea5056624101e1bc48f10d25b602635e9) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- meta/lib/oe/packagegroup.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'meta/lib/oe/packagegroup.py') diff --git a/meta/lib/oe/packagegroup.py b/meta/lib/oe/packagegroup.py index b04c45a1af..12eb4212ff 100644 --- a/meta/lib/oe/packagegroup.py +++ b/meta/lib/oe/packagegroup.py @@ -1,19 +1,26 @@ import itertools -def is_optional(group, d): - return bool(d.getVarFlag("PACKAGE_GROUP_%s" % group, "optional")) +def is_optional(feature, d): + packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True) + if packages: + return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional")) + else: + return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional")) -def packages(groups, d): - for group in groups: - for pkg in (d.getVar("PACKAGE_GROUP_%s" % group, True) or "").split(): +def packages(features, d): + for feature in features: + packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True) + if not packages: + packages = d.getVar("PACKAGE_GROUP_%s" % feature, True) + for pkg in (packages or "").split(): yield pkg -def required_packages(groups, d): - req = filter(lambda group: not is_optional(group, d), groups) +def required_packages(features, d): + req = filter(lambda feature: not is_optional(feature, d), features) return packages(req, d) -def optional_packages(groups, d): - opt = filter(lambda group: is_optional(group, d), groups) +def optional_packages(features, d): + opt = filter(lambda feature: is_optional(feature, d), features) return packages(opt, d) def active_packages(features, d): -- cgit v1.2.3-54-g00ecf