]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe.utils: add inherits (sync from OE)
authorChris Larson <chris_larson@mentor.com>
Mon, 7 Mar 2011 16:47:35 +0000 (09:47 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Mar 2011 17:51:25 +0000 (17:51 +0000)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
meta/lib/oe/utils.py

index 69f9384dc73113c10ee82344f56af2e9ed860c65..f6d4142c12e9b732636b503e845dc1b41268a8b2 100644 (file)
@@ -80,3 +80,7 @@ def param_bool(cfg, field, dflt = None):
     elif strvalue in ('no', 'n', 'false', 'f', '0'):
         return False
     raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
+
+def inherits(d, *classes):
+    """Return True if the metadata inherits any of the specified classes"""
+    return any(bb.data.inherits_class(cls, d) for cls in classes)