summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-03-19 16:06:15 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-03-19 16:06:15 +0000
commit707af031a66c5aee2bd9c1d19ef9ff36a4756e52 (patch)
tree9f39e775da3e4980d5797ae41b413dcb36d5fd35 /morphlib
parentf226330c349731d89b924e0383852cb93629a6ca (diff)
parentd10837f89c54db9da7fe0772cb59731f9713afd2 (diff)
downloadmorph-707af031a66c5aee2bd9c1d19ef9ff36a4756e52.tar.gz
Merge remote branch 'origin/master' into rm/morph-pass1
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/blobs.py6
-rw-r--r--morphlib/builddependencygraph.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/morphlib/blobs.py b/morphlib/blobs.py
index 4c1190fb..1c8686b0 100644
--- a/morphlib/blobs.py
+++ b/morphlib/blobs.py
@@ -43,8 +43,10 @@ class Blob(object):
self.parents.remove(parent)
def add_dependency(self, other):
- self.dependencies.append(other)
- other.dependents.append(self)
+ if not other in self.dependencies:
+ self.dependencies.append(other)
+ if not self in other.dependents:
+ other.dependents.append(self)
def remove_dependency(self, other):
self.dependencies.remove(other)
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' %