diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-03-19 15:06:28 +0000 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-03-19 15:07:31 +0000 |
commit | 8681a945994c12684a605ed638722f10fbc00db8 (patch) | |
tree | e3e165d188eea0417f44e66877c3e8c7885e5ffb /morphlib/builddependencygraph.py | |
parent | 0d60a83a99c80feb14b6d228f9a8426ef1f4579a (diff) | |
download | morph-8681a945994c12684a605ed638722f10fbc00db8.tar.gz |
Avoid self-dependencies, do not add dependencies multiple times.
Diffstat (limited to 'morphlib/builddependencygraph.py')
-rw-r--r-- | morphlib/builddependencygraph.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/morphlib/builddependencygraph.py b/morphlib/builddependencygraph.py index b75eab84..90c4f084 100644 --- a/morphlib/builddependencygraph.py +++ b/morphlib/builddependencygraph.py @@ -183,12 +183,14 @@ class BuildDependencyGraph(object): # pragma: no cover # chunks with no build-depends implicitly depend on all # chunks listed earlier in the same stratum for dependency in stratum_chunks: - chunk.add_dependency(dependency) + if not dependency is chunk: + chunk.add_dependency(dependency) elif isinstance(build_depends, list): for depname in build_depends: if depname in name_to_chunk: dependency = name_to_chunk[depname] - chunk.add_dependency(dependency) + if not dependency is chunk: + chunk.add_dependency(dependency) else: raise Exception('%s: source %s references %s before ' 'it is defined' % |