On Thu, Jul 19, 2012 at 01:54:38PM +0100, Lars Wirzenius wrote:
@@ -106,3 +98,42 @@ class MorphologyFactory(object):
+ def _check_and_tweak_chunk(self, morphology, reponame, sha1, filename):
+ '''Check and tweak a chunk morphology.'''
+
+ if 'chunks' in morphology and len(morphology['chunks']) > 1:
What if someone listed a chunk with a different name to the morphology?
It would be a weird thing to do, but as it is that would silently be
ignored and the artifact would be called the name of the chunk.
Suppose we have a compiler that doesn't need support libraries, it would
only have a -devel chunk.
This particular naming would be for the stratum to be split by artifact
suffix, so only -devel things would go into it.
This naming could be solved by naming it $compiler-devel, but I would
prefer its name to be $compiler.
I would prefer an exception if I had somehow made a chunk morphology
that had no chunk artifacts listed, to it silently defaulting to putting
everything in one artifact.
+ morphology.builds_artifacts =
morphology['chunks'].keys()
+ else:
+ morphology.builds_artifacts = [morphology['name']]
+