summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index 222d229a..49a23b45 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -59,10 +59,10 @@ class BuildCommand(object):
repo_name=repo_name, ref=ref, filename=filename)
self.app.status(msg='Traversing morphologies for %s' % filename)
- srcpool = self.create_source_pool(
+ self.source_pool = self.create_source_pool(
repo_name, ref, [filename], original_ref)
- self.validate_sources(srcpool)
- root_artifact = self.resolve_artifacts(srcpool)
+ self.validate_sources(self.source_pool)
+ root_artifact = self.resolve_artifacts(self.source_pool)
self.build_in_order(root_artifact)
self.app.status(
@@ -394,9 +394,25 @@ class BuildCommand(object):
def fetch_sources(self, source):
'''Update the local git repository cache with the sources.'''
+ def fetch_extra_sources(lrc, parent_repo, parent_ref, extra_sources):
+ for extra_source in extra_sources:
+ ref = extra_source.get('ref')
+ if not ref:
+ ref = parent_repo.get_submodule_commit(
+ parent_ref, extra_source['path'])
+ repo = self.lrc.get_updated_repo(extra_source['repo'],
+ ref=ref)
+ fetch_extra_sources(lrc, repo, ref,
+ extra_source.get('extra-sources', []))
+
repo_name = source.repo_name
source.repo = self.lrc.get_updated_repo(repo_name, ref=source.sha1)
- self.lrc.ensure_submodules(source.repo, source.sha1)
+ if source.morphology['kind'] == 'chunk':
+ if self.source_pool.definitions_version >= 8:
+ fetch_extra_sources(self.lrc, source.repo, source.sha1,
+ source.extra_sources)
+ else:
+ self.lrc.ensure_submodules(source.repo, source.sha1)
def cache_artifacts_locally(self, artifacts):
'''Get artifacts missing from local cache from remote cache.'''
@@ -542,7 +558,8 @@ class BuildCommand(object):
name=source.name, sha1=source.sha1[:7])
builder = morphlib.builder.Builder(
self.app, staging_area, self.lac, self.rac, self.lrc,
- 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):