summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-01-07 17:51:08 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-01-16 17:34:55 +0000
commit57692c25491c4da23dac2691e035dba8f10e14d0 (patch)
treeda07ac3c9f259df0f536582c6e5e47bca42c3970 /morphlib
parent4dcdb271865ed769b5ef2648f6779286fde2e2ed (diff)
downloadmorph-57692c25491c4da23dac2691e035dba8f10e14d0.tar.gz
Use given artifact when constructing Strata
For some reason we used to create a new Artifact object with the same name as the Stratum morphology for our cache key. This is non-sensical, since we already have an Artifact object and it breaks splitting strata. NOTE: cmdtest tests do not pass, since they list files and artifacts produced, which has changed since the new default splitting rules were added. The next patch fixes this, but was kept as a separate commit for readability.
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/builder2.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 594786e6..43ae48c4 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -476,8 +476,8 @@ class ChunkBuilder(BuilderBase):
s = self.artifact.source
extract_sources(self.app, self.repo_cache, s.repo, s.sha1, srcdir)
-class StratumBuilder(BuilderBase):
+class StratumBuilder(BuilderBase):
'''Build stratum artifacts.'''
def is_constituent(self, artifact): # pragma: no cover
@@ -513,16 +513,14 @@ class StratumBuilder(BuilderBase):
with self.build_watch('create-chunk-list'):
lac = self.local_artifact_cache
- artifact_name = self.artifact.source.morphology['name']
- artifact = self.new_artifact(artifact_name)
- contents = [x.name for x in constituents]
- meta = self.create_metadata(artifact_name, contents)
- with lac.put_artifact_metadata(artifact, 'meta') as f:
+ meta = self.create_metadata(self.artifact.name,
+ [x.name for x in constituents])
+ with lac.put_artifact_metadata(self.artifact, 'meta') as f:
json.dump(meta, f, indent=4, sort_keys=True)
- with self.local_artifact_cache.put(artifact) as f:
+ with self.local_artifact_cache.put(self.artifact) as f:
json.dump([c.basename() for c in constituents], f)
self.save_build_times()
- return [artifact]
+ return [self.artifact]
class SystemBuilder(BuilderBase): # pragma: no cover