Skip to content

Commit

Permalink
isolate version alias resolution from iteration over component set
Browse files Browse the repository at this point in the history
  • Loading branch information
mriehl committed Jan 23, 2014
1 parent bf8655b commit 749b2d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/python/yadtshell/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,19 @@ def build_unified_dependencies_tree(ignored):
components._add_when_missing_ = True
logger.debug('wiring components')
for component in components.values():
needs_with_resolved_version_alias = set([])
for needed in getattr(component, 'needs', []):
try:
needed_component = components[needed]
if not hasattr(needed_component, 'needed_by'):
needed_component.needed_by = set()
needed_component.needed_by.add(component.uri)
component.needs.remove(needed)
component.needs.add(needed_component.uri)
needs_with_resolved_version_alias.add(needed_component.uri)
except (KeyError, AttributeError), e:
logger.debug('needed: ' + needed)
raise e

component.needs = needs_with_resolved_version_alias
components._add_when_missing_ = False

for component in components.values():
Expand Down

0 comments on commit 749b2d5

Please sign in to comment.