[oe-commits] Paul Eggleton : classes/image: skip recipe on invalid IMAGE_FEATURES item

git at git.openembedded.org git at git.openembedded.org
Tue Feb 3 14:54:12 UTC 2015


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

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Mon Jan 26 15:32:23 2015 +0000

classes/image: skip recipe on invalid IMAGE_FEATURES item

If you add an item to EXTRA_IMAGE_FEATURES in your local.conf that is
not supported by image.bbclass itself (such as "tools-sdk" which is
implemented in core-image.bbclass), it can be somewhat annoying to have
the parse fall over if you have a recipe that inherits image.bbclass
only. Change the error from bb.fatal to skip the recipe instead so that
you only see the error when attempting to build the recipe, plus add a
bit of logic to report if the feature is coming in via
EXTRA_IMAGE_FEATURES.

Fixes [YOCTO #5023].

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>

---

 meta/classes/image.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index a8f3cee..d4c98db 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -52,7 +52,10 @@ def check_image_features(d):
     features = set(oe.data.typed_value('IMAGE_FEATURES', d))
     for feature in features:
         if feature not in valid_features:
-            bb.fatal("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+            if bb.utils.contains('EXTRA_IMAGE_FEATURES', feature, True, False, d):
+                raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES (added via EXTRA_IMAGE_FEATURES) is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+            else:
+                raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
 
 IMAGE_INSTALL ?= ""
 IMAGE_INSTALL[type] = "list"



More information about the Openembedded-commits mailing list