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 | openembedded-core-87dba4254b74a43bb712495ba8ebd71890a92634.tar.gz openembedded-core-87dba4254b74a43bb712495ba8ebd71890a92634.tar.bz2 openembedded-core-87dba4254b74a43bb712495ba8ebd71890a92634.zip | |
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):              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 | 
