diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-24 13:27:02 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-04-24 13:27:02 +0100 |
commit | b453fdcb08b3b8400368d0fba2a6fce9b778d03a (patch) | |
tree | f8ed9dd90877c2818afa846d0933c963666bf3cc /morphlib | |
parent | 1dbcc4fc6186c937f30daa2a176ecbed3351a28d (diff) | |
download | morph-b453fdcb08b3b8400368d0fba2a6fce9b778d03a.tar.gz |
Fix how the new builder code checks out submodules
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/builder2.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py index b8c51539..6f24e7af 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -120,6 +120,8 @@ class ChunkBuilder(BuilderBase): def get_sources(self, srcdir): # pragma: no cover '''Get sources from git to a source directory, for building.''' + cache_dir = os.path.dirname(self.artifact.source.repo.path) + def extract_repo(path, sha1, destdir): logging.debug('Extracting %s into %s' % (path, destdir)) if not os.path.exists(destdir): @@ -133,7 +135,11 @@ class ChunkBuilder(BuilderBase): except morphlib.git.NoModulesFileError: return [] else: - return [(sub.path, sub.commit, os.path.join(destdir, sub.path)) + # FIXME: This is ugly, but the best I can do atm. We need + # to combine sub.path, which is a relative path, with the + # directory in the cache where the git repos are. --liw + sub_path = os.path.join(cache_dir, sub.path) + return [(sub_path, sub.commit, os.path.join(destdir, sub.path)) for sub in submodules] s = self.artifact.source |