From 9a543b75cab2daf6536afce100cb5d6031fca9e0 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 30 Jun 2010 09:47:36 +0100 Subject: [PATCH] bitbake: Add bb.utils.join_deps to handle creation of dependency strings with versions Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 40326f98d2..86b9c724ed 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -138,6 +138,18 @@ def explode_dep_versions(s): return r +def join_deps(deps): + """ + Take the result from explode_dep_versions and generate a dependency string + """ + result = [] + for dep in deps: + if deps[dep]: + result.append(dep + " (" + deps[dep] + ")") + else: + result.append(dep) + return ", ".join(result) + def _print_trace(body, line): """ Print the Environment of a Text Body