From 87dba4254b74a43bb712495ba8ebd71890a92634 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Fri, 20 Aug 2010 09:27:22 -0700 Subject: utils.py: Add a new extend_deps() to easily merge two dependency lists Add a new extend_deps function to more easily merge two dependency lists. This avoids adding duplicates, unless the value of the dependency is different. Signed-off-by: Mark Hatle --- bitbake/lib/bb/utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 56577dabe1..c8f139b192 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -287,6 +287,17 @@ def join_deps(deps): result.append(dep) return ", ".join(result) +def extend_deps(dest, src): + """ + Extend the results from explode_dep_versions by appending all of the items + in the second list, avoiding duplicates. + """ + for dep in src: + if dep not in dest: + dest[dep] = src[dep] + elif dest[dep] != src[dep]: + dest[dep] = src[dep] + def _print_trace(body, line): """ Print the Environment of a Text Body -- cgit 1.2.3-korg