diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/lib/oe/packagegroup.py | |
download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/lib/oe/packagegroup.py')
-rw-r--r-- | meta/lib/oe/packagegroup.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oe/packagegroup.py b/meta/lib/oe/packagegroup.py new file mode 100644 index 0000000000..b04c45a1af --- /dev/null +++ b/meta/lib/oe/packagegroup.py | |||
@@ -0,0 +1,29 @@ | |||
1 | import itertools | ||
2 | |||
3 | def is_optional(group, d): | ||
4 | return bool(d.getVarFlag("PACKAGE_GROUP_%s" % group, "optional")) | ||
5 | |||
6 | def packages(groups, d): | ||
7 | for group in groups: | ||
8 | for pkg in (d.getVar("PACKAGE_GROUP_%s" % group, True) or "").split(): | ||
9 | yield pkg | ||
10 | |||
11 | def required_packages(groups, d): | ||
12 | req = filter(lambda group: not is_optional(group, d), groups) | ||
13 | return packages(req, d) | ||
14 | |||
15 | def optional_packages(groups, d): | ||
16 | opt = filter(lambda group: is_optional(group, d), groups) | ||
17 | return packages(opt, d) | ||
18 | |||
19 | def active_packages(features, d): | ||
20 | return itertools.chain(required_packages(features, d), | ||
21 | optional_packages(features, d)) | ||
22 | |||
23 | def active_recipes(features, d): | ||
24 | import oe.packagedata | ||
25 | |||
26 | for pkg in active_packages(features, d): | ||
27 | recipe = oe.packagedata.recipename(pkg, d) | ||
28 | if recipe: | ||
29 | yield recipe | ||