summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-05-03 14:21:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-03 16:19:20 +0100
commit58412ca75bc0d818c45d49d60a3ff8e1e263e42b (patch)
treef9c4411760a6ef9b8e6d7a284583aa0cc152308a
parent61823f61948df24c3329de2766c715e562711a94 (diff)
downloadpoky-58412ca75bc0d818c45d49d60a3ff8e1e263e42b.tar.gz
classes/image: allow complementary package globs to be extended
Make it easy for the wildcard specifications for complementary package features to be extended outside of image.bbclass. For example, to add a new "foo-pkgs" item that could be added to IMAGE_FEATURES that would cause *-foo packages to be installed for all packages currently in the image, you can now use this line at the global level: COMPLEMENTARY_GLOB[foo-pkgs] = "*-foo" Implements [YOCTO #4228]. (From OE-Core rev: 4e39c1b9dbba1d2b07ffc2c6a1a252fc8f7680ee) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image.bbclass23
1 files changed, 11 insertions, 12 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ffb372aebb..5bc0ca2d66 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -33,7 +33,7 @@ NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages
33 33
34def normal_groups(d): 34def normal_groups(d):
35 """Return all the IMAGE_FEATURES, with the exception of our special package groups""" 35 """Return all the IMAGE_FEATURES, with the exception of our special package groups"""
36 extras = set(['dev-pkgs', 'staticdev-pkgs', 'doc-pkgs', 'dbg-pkgs', 'ptest-pkgs']) 36 extras = set(d.getVarFlags('COMPLEMENTARY_GLOB').keys())
37 features = set(oe.data.typed_value('IMAGE_FEATURES', d)) 37 features = set(oe.data.typed_value('IMAGE_FEATURES', d))
38 return features.difference(extras) 38 return features.difference(extras)
39 39
@@ -43,20 +43,19 @@ PACKAGE_GROUP_splash = "${SPLASH}"
43 43
44# Wildcards specifying complementary packages to install for every package that has been explicitly 44# Wildcards specifying complementary packages to install for every package that has been explicitly
45# installed into the rootfs 45# installed into the rootfs
46COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev'
47COMPLEMENTARY_GLOB[staticdev-pkgs] = '*-staticdev'
48COMPLEMENTARY_GLOB[doc-pkgs] = '*-doc'
49COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
50COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest'
51
46def complementary_globs(featurevar, d): 52def complementary_globs(featurevar, d):
53 all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
47 globs = [] 54 globs = []
48 features = set((d.getVar(featurevar, True) or '').split()) 55 features = set((d.getVar(featurevar, True) or '').split())
49 for feature in features: 56 for name, glob in all_globs.items():
50 if feature == 'dev-pkgs': 57 if name in features:
51 globs.append('*-dev') 58 globs.append(glob)
52 elif feature == 'staticdev-pkgs':
53 globs.append('*-staticdev')
54 elif feature == 'doc-pkgs':
55 globs.append('*-doc')
56 elif feature == 'dbg-pkgs':
57 globs.append('*-dbg')
58 elif feature == 'ptest-pkgs':
59 globs.append('*-ptest')
60 return ' '.join(globs) 59 return ' '.join(globs)
61 60
62IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}' 61IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'