summaryrefslogtreecommitdiff
path: root/morphlib/builder.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r--morphlib/builder.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index e2abee9e..eb7fdfc1 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -60,18 +60,22 @@ def extract_sources(app, definitions_version, repo_cache, repo, sha1,
return tuples
return []
- def extract_repo_version_8(repo, ref, extra_sources,
+ def extract_repo_version_8(repo, sha1, extra_sources,
rootdir, destdir):
app.status(msg='Extracting %(source)s into %(path)s',
source=repo.original_name,
path=destdir)
- repo.checkout(ref, destdir)
+ morphlib.gitdir.checkout_from_cached_repo(repo, sha1, destdir)
morphlib.git.reset_workdir(app.runcmd, destdir)
for extra_source in extra_sources:
- subrepo = repo_cache.get_repo(extra_source['repo'])
+ subref = extra_source.get('ref')
path = os.path.normpath(extra_source['path'])
+ if not subref:
+ subref = repo.get_submodule_commit(sha1, path)
+ subrepo = repo_cache.get_updated_repo(extra_source['repo'],
+ subref)
checkout_dir = os.path.join(destdir, path)
if os.path.exists(checkout_dir):
if os.listdir(checkout_dir):
@@ -82,9 +86,6 @@ def extract_sources(app, definitions_version, repo_cache, repo, sha1,
rootdir, path)))
else:
os.makedirs(checkout_dir)
- subref = extra_source.get('ref')
- if not subref:
- subref = repo.get_submodule_commit(ref, path)
extract_repo_version_8(subrepo, subref,
extra_source.get('extra-sources', []),