summaryrefslogtreecommitdiff
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
parentf226330c349731d89b924e0383852cb93629a6ca (diff)
parentd10837f89c54db9da7fe0772cb59731f9713afd2 (diff)
downloadmorph-707af031a66c5aee2bd9c1d19ef9ff36a4756e52.tar.gz
Merge remote branch 'origin/master' into rm/morph-pass1
-rw-r--r--morphlib/blobs.py6
-rw-r--r--morphlib/builddependencygraph.py6
-rwxr-xr-xrun-bootstrap-in-chroot8
3 files changed, 15 insertions, 5 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' %
diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot
index 2c2e420d..1ce70790 100755
--- a/run-bootstrap-in-chroot
+++ b/run-bootstrap-in-chroot
@@ -31,7 +31,13 @@ update_morph()
cp baserock-bootstrap "$dir/." # update bootstrap script
rm -rf "$dir/tree/baserock/gits/morph"
mkdir -p "$dir/tree/baserock/gits/morph"
- cp -r . "$dir/tree/baserock/gits/morph/."
+
+ # Copy everything except the target directory into the target directory.
+ # The point is to be able to keep the working area for a bootstrap inside
+ # the morph source directory. This is useful for Jenkins jobs.
+ local base=$(basename $(basename "$dir"))
+ find . -mindepth 1 -maxdepth 1 ! -name "$base" \
+ -exec cp -av '{}' "$dir/tree/baserock/gits/morph" ';'
}
run_pass()