]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/utils: Add build_depends_string function
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 19:31:54 +0000 (19:31 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 22:50:12 +0000 (22:50 +0000)
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@linuxfoundation.org>
meta/lib/oe/utils.py

index 76806b5195d531e64f0ad3c71d0d5e9cf17e141e..330a5ff94a6fdbef59d0d5f35ce7fb0c527093a3 100644 (file)
@@ -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)