summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/utils.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-19 19:31:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-20 11:53:49 +0000
commiteeb30764e9ac712dd2512aedecb6b5e53eafd9c2 (patch)
treed15089f4b1e213fc86d03be85a25674944403754 /meta/lib/oe/utils.py
parent70851481165de030b07cbd28b1c3a27c2db3052b (diff)
downloadpoky-eeb30764e9ac712dd2512aedecb6b5e53eafd9c2.tar.gz
lib/oe/utils: Add build_depends_string function
This is useful when manipulating depends strings for task [depends] flags and is slightly easier to parse than some inline python. (From OE-Core rev: 7b05ea65a8db8a27b2a5579675775ee34ceb63c2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r--meta/lib/oe/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 76806b5195..330a5ff94a 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -97,6 +97,10 @@ def param_bool(cfg, field, dflt = None):
97 return False 97 return False
98 raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value)) 98 raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
99 99
100def build_depends_string(depends, task):
101 """Append a taskname to a string of dependencies as used by the [depends] flag"""
102 return " ".join(dep + ":" + task for dep in depends.split())
103
100def inherits(d, *classes): 104def inherits(d, *classes):
101 """Return True if the metadata inherits any of the specified classes""" 105 """Return True if the metadata inherits any of the specified classes"""
102 return any(bb.data.inherits_class(cls, d) for cls in classes) 106 return any(bb.data.inherits_class(cls, d) for cls in classes)