From: Mark Hatle Date: Fri, 20 Aug 2010 16:27:22 +0000 (-0700) Subject: utils.py: Add a new extend_deps() to easily merge two dependency lists X-Git-Tag: 2011-1~4784 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=87dba4254b74a43bb712495ba8ebd71890a92634;p=openembedded-core.git 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 --- 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