summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-11 16:08:26 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-10-11 17:40:04 +0100
commit3107bc357e6214897ae99dc8ecb26cfe624ab5d9 (patch)
tree48ff8ade6e71fb181ac171b9744f5133189cd84c
parentde6180d4cd4e4f29c12dcaea876d7e88659dc7dc (diff)
downloadmorph-3107bc357e6214897ae99dc8ecb26cfe624ab5d9.tar.gz
Warn about unknown morphology fields
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index 6d8387eb..c2e70dc8 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -302,6 +302,31 @@ class BranchAndMergePlugin(cliapp.Plugin):
]
}
+ also_known = {
+ 'system': [
+ 'kind',
+ 'description',
+ 'disk-size',
+ '_disk-size',
+ ],
+ 'stratum': [
+ 'kind',
+ 'description',
+ 'build-depends',
+ ],
+ 'chunk': [
+ 'kind',
+ 'description',
+ 'build-system',
+ 'configure-commands',
+ 'build-commands',
+ 'test-commands',
+ 'install-commands',
+ 'max-jobs',
+ 'chunks',
+ ]
+ }
+
require('kind')
kind = morphology['kind']
if kind not in required:
@@ -309,6 +334,13 @@ class BranchAndMergePlugin(cliapp.Plugin):
'Unknown morphology kind "%s" in %s' % (kind, basename))
for field in required[kind]:
require(field)
+
+ known = required[kind] + also_known[kind]
+ for field in morphology.keys():
+ if field not in known:
+ msg = 'Unknown field "%s" in %s' % (field, basename)
+ logging.warning(msg)
+ self.app.status(msg=msg)
def reset_work_tree_safe(self, repo_dir):
# This function avoids throwing any exceptions, so it is safe to call