diff options
author | Richard Maw <richard.maw@gmail.com> | 2014-09-03 21:03:56 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@gmail.com> | 2014-09-19 12:43:26 +0000 |
commit | 30bd3185050bc7997a032ca32f0a5ac9b5e76ed9 (patch) | |
tree | 8f2c011823945af4d79e9e5bc850477a61b58e5f /morphlib/buildcommand.py | |
parent | e3400ec5a25b5163293adcb0d007d0a8cae53a4c (diff) | |
download | morph-30bd3185050bc7997a032ca32f0a5ac9b5e76ed9.tar.gz |
Create multiple sources per stratum morphology
Building per-artifact results in undesirable behaviour,
as multiple artifacts are produced for every chunk build.
It therefore makes more sense to build per-source.
This implies that actually, the model of one source per
morphology is wrong and we should move the dependencies
into the source.
Unlike chunks however, where every chunk artifact has the
same dependencies, stratum artifacts can have different
dependencies.
So before we can move the dependencies into the Source,
we need to have as many Sources as Stratum Artifacts.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 352b43d2..436e23eb 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -208,7 +208,7 @@ class BuildCommand(object): # a build-dependency, then they must both have the same Repository # and Ref specified. if src.morphology['kind'] == 'stratum': - name = src.morphology['name'] + name = src.name ref = src.sha1[:7] self.app.status(msg='Stratum [%(name)s] version is %(ref)s', name=name, ref=ref) @@ -236,18 +236,18 @@ class BuildCommand(object): logging.debug( 'Validating cross ref to %s:%s:%s' % (repo_name, ref, filename)) - other = srcpool.lookup(repo_name, ref, filename) - if other.morphology['kind'] != wanted: - raise morphlib.Error( - '%s %s references %s:%s:%s which is a %s, ' - 'instead of a %s' % - (src.morphology['kind'], - src.morphology['name'], - repo_name, - ref, - filename, - other.morphology['kind'], - wanted)) + for other in srcpool.lookup(repo_name, ref, filename): + if other.morphology['kind'] != wanted: + raise morphlib.Error( + '%s %s references %s:%s:%s which is a %s, ' + 'instead of a %s' % + (src.morphology['kind'], + src.name, + repo_name, + ref, + filename, + other.morphology['kind'], + wanted)) def _find_root_artifacts(self, artifacts): '''Find all the root artifacts among a set of artifacts in a DAG. |