summaryrefslogtreecommitdiff
path: root/morphlib/app.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-07-02 17:09:59 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-07-03 12:11:34 +0100
commite3e84967d2b0d19825d278c1b73bee8fb48d83ba (patch)
treef809276b3becbed6ef6e1d2756c93335cf3b8ad2 /morphlib/app.py
parent6e714069d11dbbad0b81aefb0e30b883ba40dc7a (diff)
downloadmorph-e3e84967d2b0d19825d278c1b73bee8fb48d83ba.tar.gz
build: install recursive deps in staging area
All of the dependencies need to be installed, so generate the transitive closiure to pass to cache_artifacts_locally and install_chunk_artifacts.
Diffstat (limited to 'morphlib/app.py')
-rwxr-xr-xmorphlib/app.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index e7dc844b..196b9874 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -204,12 +204,13 @@ class BuildCommand(object):
kind=artifact.source.morphology['kind'],
name=artifact.name)
self.get_sources(artifact)
- self.cache_artifacts_locally(artifact.dependencies)
+ deps = self.get_recursive_deps(artifact)
+ self.cache_artifacts_locally(deps)
staging_area = self.create_staging_area(artifact)
if self.app.settings['staging-chroot']:
self.install_fillers(staging_area)
self.install_chunk_artifacts(staging_area,
- artifact.dependencies)
+ deps)
self.build_and_cache(staging_area, artifact)
if self.app.settings['bootstrap']:
self.install_chunk_artifacts(staging_area,
@@ -220,6 +221,17 @@ class BuildCommand(object):
'''Does either cache already have the artifact?'''
return self.lac.has(artifact) or (self.rac and self.rac.has(artifact))
+ def get_recursive_deps(self, artifact):
+ done = set()
+ self._get_recursive_deps(artifact, done)
+ return done
+
+ def _get_recursive_deps(self, artifact, done):
+ for a in artifact.dependencies:
+ if a not in done:
+ done.add(a)
+ self._get_recursive_deps(a, done)
+
def get_sources(self, artifact):
'''Update the local git repository cache with the sources.'''