summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2016-02-11 13:55:00 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2016-02-11 13:55:00 +0000
commitd5c616d8287d94514d1323c7b5e6d6d2936a942d (patch)
treeacccdd43bca0af413bc63e56b50e11862ff8d855
parent8698688309aa8ff6e06fc5b060535501711de6c4 (diff)
downloadmorph-d5c616d8287d94514d1323c7b5e6d6d2936a942d.tar.gz
Fix breakage when new build systems are added to DEFAULTS
It turns out that one part of Morph was still using the predefined build systems that were built into the 'morphlib.buildsystem' Python module, instead of using the ones from the DEFAULTS file. This meant that Morph wasn't actually implementing Baserock definitions version 7 properly. https://storyboard.baserock.org/#!/story/72 Change-Id: I440a8f7455874a1b8491b48b0b122792aa8189ae
-rw-r--r--morphlib/sourceresolver.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py
index a94ff66f..4f6d38ea 100644
--- a/morphlib/sourceresolver.py
+++ b/morphlib/sourceresolver.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2015 Codethink Limited
+# Copyright (C) 2014-2016 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -363,7 +363,7 @@ class SourceResolver(object):
def process_chunk(self, resolved_morphologies, resolved_trees,
definitions_checkout_dir, morph_loader, chunk_repo,
chunk_ref, filename, chunk_buildsystem, visit,
- predefined_split_rules):
+ predefined_build_systems, predefined_split_rules):
absref, tree = self._resolve_ref(resolved_trees, chunk_repo, chunk_ref)
if chunk_buildsystem is None:
@@ -377,8 +377,11 @@ class SourceResolver(object):
# Chunk uses one of the predefined build systems. In this case
# 'filename' will be faked (name of chunk + '.morph').
- buildsystem = morphlib.buildsystem.lookup_build_system(
- chunk_buildsystem)
+ try:
+ buildsystem = predefined_build_systems[chunk_buildsystem]
+ except KeyError:
+ raise SourceResolverError("Unknown build system for %s: %s" %
+ (filename, chunk_buildsystem))
morphology = self._create_morphology_for_build_system(
morph_loader, buildsystem, filename)
@@ -436,6 +439,7 @@ class SourceResolver(object):
self.process_chunk(resolved_morphologies, resolved_trees,
definitions_checkout_dir, morph_loader,
repo, ref, filename, buildsystem, visit,
+ predefined_build_systems,
predefined_split_rules)
class DuplicateChunkError(morphlib.Error):