Skip to content
Snippets Groups Projects
Commit 69ff3d33 authored by Sree Kuchibhotla's avatar Sree Kuchibhotla
Browse files

Merge pull request #4693 from murgatroid99/transitive_deps_plugin_fix

Allow transitive dependencies plugin to process non-existent libs wit…
parents 0ade2d41 4518bf7f
No related branches found
No related tags found
No related merge requests found
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
...@@ -36,10 +36,13 @@ of the list of dependencies. ...@@ -36,10 +36,13 @@ of the list of dependencies.
""" """
def get_lib(libs, name): def get_lib(libs, name):
return next(lib for lib in libs if lib['name']==name) try:
return next(lib for lib in libs if lib['name']==name)
except StopIteration:
return None
def transitive_deps(lib, libs): def transitive_deps(lib, libs):
if 'deps' in lib: if lib is not None and 'deps' in lib:
# Recursively call transitive_deps on each dependency, and take the union # Recursively call transitive_deps on each dependency, and take the union
return set.union(set(lib['deps']), return set.union(set(lib['deps']),
*[set(transitive_deps(get_lib(libs, dep), libs)) *[set(transitive_deps(get_lib(libs, dep), libs))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment