[OE-core] [PATCH 01/33] lib/oe/utils: Add build_depends_string function

Richard Purdie richard.purdie at linuxfoundation.org
Thu Jan 19 22:52:43 UTC 2017


This is useful when manipulating depends strings for task [depends]
flags and is slightly easier to parse than some inline python.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/utils.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 76806b5..330a5ff 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -97,6 +97,10 @@ def param_bool(cfg, field, dflt = None):
         return False
     raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
 
+def build_depends_string(depends, task):
+    """Append a taskname to a string of dependencies as used by the [depends] flag"""
+    return " ".join(dep + ":" + task for dep in depends.split())
+
 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)
-- 
2.7.4



More information about the Openembedded-core mailing list