Commit c9353605 authored by Paweł Hajdan, Jr's avatar Paweł Hajdan, Jr Committed by Commit Bot

gclient flatten: fixes for chromium/src

- allow variables with same names as long as values are also the same

- allow recursedeps entries referencing deps_os entries

Bug: 570091
Change-Id: I4abbd255982368a0ee33e8f3de631f3d18adf6ab
Reviewed-on: https://chromium-review.googlesource.com/583649Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
parent ecdfa41d
......@@ -1775,7 +1775,9 @@ class Flattener(object):
self._deps[dep.name] = dep
for key, value in dep.get_vars().iteritems():
assert key not in self._vars
# Make sure there are no conflicting variables. It is fine however
# to use same variable name, as long as the value is consistent.
assert key not in self._vars or self._vars[key][1] == value
self._vars[key] = (dep, value)
self._hooks.extend([(dep, hook) for hook in dep.deps_hooks])
......@@ -1788,6 +1790,13 @@ class Flattener(object):
self._add_deps_os(dep)
deps_by_name = dict((d.name, d) for d in dep.dependencies)
# Allow recursedeps entries that refer to deps_os entries.
# In case there are multiple entries with the same name,
# we have to pick something - e.g. the first one.
for os_deps in dep.os_dependencies.itervalues():
for os_dep in os_deps:
if os_dep.name not in deps_by_name:
deps_by_name[os_dep.name] = os_dep
for recurse_dep_name in (dep.recursedeps or []):
self._flatten_recurse(deps_by_name[recurse_dep_name])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment