From 57692c25491c4da23dac2691e035dba8f10e14d0 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Tue, 7 Jan 2014 17:51:08 +0000 Subject: 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. --- morphlib/builder2.py | 14 ++++++-------- 1 file 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 -- cgit v1.2.1