summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-10 14:01:06 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-11 16:04:44 +0000
commit6db681a663353fd38bd192036b5001c631bb366a (patch)
tree40a997c4f7e26bcc705e0e258b949d81b1cc8885
parent868007ec418b126ab74d6899d6694aff23e8f50a (diff)
downloadmorph-6db681a663353fd38bd192036b5001c631bb366a.tar.gz
buildcommand: Think per-source not per-artifact
-rw-r--r--morphlib/buildcommand.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index ed131c74..000a84e5 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -349,8 +349,8 @@ class BuildCommand(object):
build_mode = source.build_mode
extra_env = {'PREFIX': source.prefix}
- dep_prefix_set = set(a.source.prefix for a in deps
- if a.source.morphology['kind'] == 'chunk')
+ dep_prefix_set = set(source.prefix for source in deps
+ if source.morphology['kind'] == 'chunk')
extra_path = [os.path.join(d, 'bin') for d in dep_prefix_set]
if build_mode not in ['bootstrap', 'staging', 'test']:
@@ -429,7 +429,7 @@ class BuildCommand(object):
return set(s.morphology for s in dependent_strata)
return dependent_stratum_morphs(s1) == dependent_stratum_morphs(s2)
- def install_dependencies(self, staging_area, artifacts, target_source):
+ def install_dependencies(self, staging_area, sources, target_source):
'''Install chunk artifacts into staging area.
We only ever care about chunk artifacts as build dependencies,
@@ -440,19 +440,20 @@ class BuildCommand(object):
'''
- for artifact in artifacts:
- if artifact.source.morphology['kind'] != 'chunk':
+ for source in sources:
+ if source.morphology['kind'] != 'chunk':
continue
- if artifact.source.build_mode == 'bootstrap':
- if not self.in_same_stratum(artifact.source, target_source):
+ if source.build_mode == 'bootstrap':
+ if not self.in_same_stratum(source, target_source):
continue
self.app.status(
msg='Installing chunk %(chunk_name)s from cache %(cache)s',
- chunk_name=artifact.name,
- cache=artifact.source.cache_key[:7],
+ chunk_name=source.name,
+ cache=source.cache_key[:7],
chatty=True)
- handle = self.lac.get(artifact)
- staging_area.install_artifact(handle)
+ for artifact in source.artifacts.values():
+ handle = self.lac.get(artifact)
+ staging_area.install_artifact(handle)
if target_source.build_mode == 'staging':
morphlib.builder.ldconfig(self.app.runcmd, staging_area.dirname)