From: Chris Larson Date: Mon, 7 Mar 2011 16:47:35 +0000 (-0700) Subject: oe.utils: add inherits (sync from OE) X-Git-Tag: 2011-1~1973 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=0bdb38820489a69448e36c75863e2e2d47cdb20f;p=openembedded-core.git oe.utils: add inherits (sync from OE) Signed-off-by: Chris Larson --- diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 69f9384dc7..f6d4142c12 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)