mirror of
https://git.yoctoproject.org/poky
synced 2026-06-04 02:00:04 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
61823f6194
commit
58412ca75b
+11
-12
@@ -33,7 +33,7 @@ NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages
|
|||||||
|
|
||||||
def normal_groups(d):
|
def normal_groups(d):
|
||||||
"""Return all the IMAGE_FEATURES, with the exception of our special package groups"""
|
"""Return all the IMAGE_FEATURES, with the exception of our special package groups"""
|
||||||
extras = set(['dev-pkgs', 'staticdev-pkgs', 'doc-pkgs', 'dbg-pkgs', 'ptest-pkgs'])
|
extras = set(d.getVarFlags('COMPLEMENTARY_GLOB').keys())
|
||||||
features = set(oe.data.typed_value('IMAGE_FEATURES', d))
|
features = set(oe.data.typed_value('IMAGE_FEATURES', d))
|
||||||
return features.difference(extras)
|
return features.difference(extras)
|
||||||
|
|
||||||
@@ -43,20 +43,19 @@ PACKAGE_GROUP_splash = "${SPLASH}"
|
|||||||
|
|
||||||
# Wildcards specifying complementary packages to install for every package that has been explicitly
|
# Wildcards specifying complementary packages to install for every package that has been explicitly
|
||||||
# installed into the rootfs
|
# installed into the rootfs
|
||||||
|
COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev'
|
||||||
|
COMPLEMENTARY_GLOB[staticdev-pkgs] = '*-staticdev'
|
||||||
|
COMPLEMENTARY_GLOB[doc-pkgs] = '*-doc'
|
||||||
|
COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
|
||||||
|
COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest'
|
||||||
|
|
||||||
def complementary_globs(featurevar, d):
|
def complementary_globs(featurevar, d):
|
||||||
|
all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
|
||||||
globs = []
|
globs = []
|
||||||
features = set((d.getVar(featurevar, True) or '').split())
|
features = set((d.getVar(featurevar, True) or '').split())
|
||||||
for feature in features:
|
for name, glob in all_globs.items():
|
||||||
if feature == 'dev-pkgs':
|
if name in features:
|
||||||
globs.append('*-dev')
|
globs.append(glob)
|
||||||
elif feature == 'staticdev-pkgs':
|
|
||||||
globs.append('*-staticdev')
|
|
||||||
elif feature == 'doc-pkgs':
|
|
||||||
globs.append('*-doc')
|
|
||||||
elif feature == 'dbg-pkgs':
|
|
||||||
globs.append('*-dbg')
|
|
||||||
elif feature == 'ptest-pkgs':
|
|
||||||
globs.append('*-ptest')
|
|
||||||
return ' '.join(globs)
|
return ' '.join(globs)
|
||||||
|
|
||||||
IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
|
IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
|
||||||
|
|||||||
Reference in New Issue
Block a user