diff options
author | Mark Hatle <mhatle@windriver.com> | 2010-08-20 09:27:22 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 23:46:08 +0100 |
commit | 87dba4254b74a43bb712495ba8ebd71890a92634 (patch) | |
tree | c5b902403609798dd9ea97a7679bea2f8addde46 /bitbake/lib | |
parent | 54e3a82d9c14f3071db4a4f78312c0e31534696c (diff) | |
download | poky-87dba4254b74a43bb712495ba8ebd71890a92634.tar.gz |
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 <mhatle@windriver.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 11 |
1 files changed, 11 insertions, 0 deletions
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): | |||
287 | result.append(dep) | 287 | result.append(dep) |
288 | return ", ".join(result) | 288 | return ", ".join(result) |
289 | 289 | ||
290 | def extend_deps(dest, src): | ||
291 | """ | ||
292 | Extend the results from explode_dep_versions by appending all of the items | ||
293 | in the second list, avoiding duplicates. | ||
294 | """ | ||
295 | for dep in src: | ||
296 | if dep not in dest: | ||
297 | dest[dep] = src[dep] | ||
298 | elif dest[dep] != src[dep]: | ||
299 | dest[dep] = src[dep] | ||
300 | |||
290 | def _print_trace(body, line): | 301 | def _print_trace(body, line): |
291 | """ | 302 | """ |
292 | Print the Environment of a Text Body | 303 | Print the Environment of a Text Body |