diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-10-08 20:05:06 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-10-09 18:28:00 -0700 |
commit | b0edd6725d289730c5fca49ea28a644b9186493c (patch) | |
tree | ca8557aecfc7e10aca7aeda7c220dbc4ae7fcbca /lib | |
parent | 7791fdfc5ebafbd52b7921cd4a1ffc77699afb06 (diff) | |
download | openembedded-b0edd6725d289730c5fca49ea28a644b9186493c.tar.gz |
oe.packagegroup: add code for package groups
This includes some utility functions for dealing with groups of packages
defined in the metadata. Metadata syntax:
PACKAGE_GROUP_<group> = "<list of packages>"
If the packages in the group are optional:
PACKAGE_GROUP_<group>[optional] = "1"
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oe/packagegroup.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/oe/packagegroup.py b/lib/oe/packagegroup.py new file mode 100644 index 0000000000..6dc9cd7e28 --- /dev/null +++ b/lib/oe/packagegroup.py @@ -0,0 +1,15 @@ +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) + +def required_packages(groups, d): + req = filter(lambda group: not is_optional(group, d), groups) + return " ".join(packages(req, d)) + +def optional_packages(groups, d): + opt = filter(lambda group: is_optional(group, d), groups) + return " ".join(packages(opt, d)) |