summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-26 18:59:01 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-26 19:27:19 +0000
commit45e39e81698df91251c7fac5a642e211e98d834b (patch)
treef4d2fa2774dd29f302617002bd8da417928a1408 /morphlib/buildcommand.py
parent9404317020ff0455cbfd3ca7976d546af823759b (diff)
downloadmorph-45e39e81698df91251c7fac5a642e211e98d834b.tar.gz
Add support for definitions version 8baserock/pedroalvarez/defv8-submodules-squashed
This code is a rework from changes done by: - Tiago Gomes <tiago.gomes@codethink.co.uk> https://storyboard.baserock.org/#!/story/86 Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index e185a808..346fdc8a 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -95,6 +95,7 @@ class BuildCommand(object):
self.repo_cache, repo_name, ref, filenames,
original_ref=original_ref,
status_cb=self.app.status)
+ self.source_pool = srcpool
return srcpool
def validate_sources(self, srcpool):
@@ -391,7 +392,12 @@ class BuildCommand(object):
repo_name = source.repo_name
source.repo = self.repo_cache.get_updated_repo(repo_name,
ref=source.sha1)
- self.repo_cache.ensure_submodules(source.repo, source.sha1)
+ if source.morphology['kind'] == 'chunk':
+ if self.source_pool.definitions_version >= 8:
+ self.repo_cache.ensure_submodules(
+ source.repo, source.sha1, source.submodules)
+ else:
+ self.repo_cache.ensure_submodules(source.repo, source.sha1)
def cache_artifacts_locally(self, artifacts):
'''Get artifacts missing from local cache from remote cache.'''
@@ -537,7 +543,8 @@ class BuildCommand(object):
name=source.name, sha1=source.sha1[:7])
builder = morphlib.builder.Builder(
self.app, staging_area, self.lac, self.rac, self.repo_cache,
- self.app.settings['max-jobs'], setup_mounts)
+ self.app.settings['max-jobs'], setup_mounts,
+ self.source_pool.definitions_version)
return builder.build_and_cache(source)
class InitiatorBuildCommand(BuildCommand):