aboutsummaryrefslogtreecommitdiffstats
path: root/lib/oe/packagegroup.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-10-09 22:22:44 -0700
committerChris Larson <chris_larson@mentor.com>2010-10-09 22:38:03 -0700
commita3fa60656f2d411e1d726eae095fe65bbd0bcda4 (patch)
treecbabf8e61366d53f8fd54c71346daff9abaf38bb /lib/oe/packagegroup.py
parent77734527095b04989c7773f6bc5a941faae532eb (diff)
downloadopenembedded-a3fa60656f2d411e1d726eae095fe65bbd0bcda4.tar.gz
Implement 'dbg', 'dev', and 'doc' package groups
These allow one to include debugging, development, and documentation files for all packages installed in the image, via IMAGE_FEATURES. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/oe/packagegroup.py')
-rw-r--r--lib/oe/packagegroup.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/oe/packagegroup.py b/lib/oe/packagegroup.py
index 6dc9cd7e28..7371fa72ce 100644
--- a/lib/oe/packagegroup.py
+++ b/lib/oe/packagegroup.py
@@ -1,15 +1,28 @@
+import itertools
+
def is_optional(group, d):
return bool(d.getVarFlag("PACKAGE_GROUP_%s" % group, "optional"))
def packages(groups, d):
- from itertools import chain
- return chain.from_iterable(d.getVar("PACKAGE_GROUP_%s" % group, True).split()
- for group in groups)
+ return itertools.chain.from_iterable(d.getVar("PACKAGE_GROUP_%s" % group, True).split()
+ for group in groups)
def required_packages(groups, d):
req = filter(lambda group: not is_optional(group, d), groups)
- return " ".join(packages(req, d))
+ return packages(req, d)
def optional_packages(groups, d):
opt = filter(lambda group: is_optional(group, d), groups)
- return " ".join(packages(opt, d))
+ return packages(opt, d)
+
+def active_packages(features, d):
+ return itertools.chain(required_packages(features, d),
+ optional_packages(features, d))
+
+def active_recipes(features, d):
+ import oe.packagedata
+
+ for pkg in active_packages(features, d):
+ recipe = oe.packagedata.recipename(pkg, d)
+ if recipe:
+ yield recipe