diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-25 13:55:01 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-25 21:02:34 +0000 |
commit | b72cc9a9ea7537125bcd813473ee52dc39712719 (patch) | |
tree | 060cc8fd5ec3fc6bf99e3c95447b9da2bd3238ad /morphlib/builder.py | |
parent | bfecb5c86bb6e80e8cd89b2ab87952024bd801f9 (diff) | |
download | morph-b72cc9a9ea7537125bcd813473ee52dc39712719.tar.gz |
Fixes needed
Change-Id: Ie527ff7228987afbfcce3c105d6d9192a366e65d
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r-- | morphlib/builder.py | 13 |
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', []), |