]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/image: skip recipe on invalid IMAGE_FEATURES item
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 26 Jan 2015 15:32:23 +0000 (15:32 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 Feb 2015 14:53:40 +0000 (14:53 +0000)
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@linux.intel.com>
meta/classes/image.bbclass

index a8f3ceea7fe1eb5dbd98c2ac433d9b718e862346..d4c98db9ea586853090bdfd77c624f2bcaeafa9c 100644 (file)
@@ -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"