[OE-core] [PATCH 04/12] oe.utils: add inherits (sync from OE)

Chris Larson kergoth at gmail.com
Thu Mar 17 16:19:02 UTC 2011


From: Chris Larson <chris_larson at mentor.com>

Signed-off-by: Chris Larson <chris_larson at mentor.com>
---
 meta/lib/oe/utils.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 69f9384..f6d4142 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -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)
-- 
1.7.2.3





More information about the Openembedded-core mailing list