[oe-commits] Chris Larson : image: add support for generally useful {dev, doc, dbg}-pkgs features

git version control git at git.openembedded.org
Wed Aug 10 12:35:37 UTC 2011


Module: openembedded-core.git
Branch: master
Commit: 7fd8fe53072d3bebb31da4e556878d3c25a10478
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=7fd8fe53072d3bebb31da4e556878d3c25a10478

Author: Chris Larson <chris_larson at mentor.com>
Date:   Mon Aug  8 16:12:08 2011 -0700

image: add support for generally useful {dev,doc,dbg}-pkgs features

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 meta/classes/image.bbclass |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index e057329..54eb78b 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -6,8 +6,8 @@ inherit imagetest-${IMAGETEST}
 LICENSE = "MIT"
 PACKAGES = ""
 MULTILIB_IMAGE_INSTALL ?= ""
-RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL} ${FEATURE_INSTALL}"
-RRECOMMENDS += "${FEATURE_INSTALL_OPTIONAL}"
+RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL} ${NORMAL_FEATURE_INSTALL}"
+RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -19,6 +19,36 @@ IMAGE_FEATURES[type] = "list"
 FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 
+# packages to install from features, excluding dev/dbg/doc
+NORMAL_FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(normal_groups(d), d))}"
+NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(normal_groups(d), d))}"
+
+def normal_groups(d):
+    """Return all the IMAGE_FEATURES, with the exception of our special package groups"""
+    extras = set(['dev-pkgs', 'doc-pkgs', 'dbg-pkgs'])
+    features = set(oe.data.typed_value('IMAGE_FEATURES', d))
+    return features.difference(extras)
+
+def normal_pkgs_to_install(d):
+    import oe.packagedata
+
+    to_install = oe.data.typed_value('IMAGE_INSTALL', d)
+    features = normal_groups(d)
+    required = list(oe.packagegroup.required_packages(features, d))
+    optional = list(oe.packagegroup.optional_packages(features, d))
+    all_packages = to_install + required + optional
+
+    recipes = filter(None, [oe.packagedata.recipename(pkg, d) for pkg in all_packages])
+
+    return all_packages + recipes
+
+PACKAGE_GROUP_dbg-pkgs = "${@' '.join('%s-dbg' % pkg for pkg in normal_pkgs_to_install(d))}"
+PACKAGE_GROUP_dbg-pkgs[optional] = "1"
+PACKAGE_GROUP_dev-pkgs = "${@' '.join('%s-dev' % pkg for pkg in normal_pkgs_to_install(d))}"
+PACKAGE_GROUP_dev-pkgs[optional] = "1"
+PACKAGE_GROUP_doc-pkgs = "${@' '.join('%s-doc' % pkg for pkg in normal_pkgs_to_install(d))}"
+PACKAGE_GROUP_doc-pkgs[optional] = "1"
+
 # "export IMAGE_BASENAME" not supported at this time
 IMAGE_INSTALL ?= ""
 IMAGE_INSTALL[type] = "list"





More information about the Openembedded-commits mailing list