summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-02-13 13:05:22 (GMT)
committerBaserock Gerrit <gerrit@baserock.org>2016-02-25 18:23:06 (GMT)
commitc1aa6a47e792cfa61b67eccee401fcb77cd57591 (patch)
tree5a717423fdf1bb9dea298da713f79d353a080b0b
parentfb6dd955cbc7081f47dc43919075dc4eb3809172 (diff)
downloadmorph-c1aa6a47e792cfa61b67eccee401fcb77cd57591.tar.gz
Warning when different names in strata/chunks
Now is an warning when the name of a chunk in a stratum is different from the name of the chunk in the chunk file. Example of the warning message: WARNING: Name 'binutils' doesn't match 'binutils-foo' in morphology: strata/build-essential/binutils.morph Change-Id: I38f0ccff57fc25db12c572fdc8a01dbd6434f01c
-rw-r--r--morphlib/sourceresolver.py4
-rw-r--r--yarns/implementations.yarn2
2 files changed, 5 insertions, 1 deletions
diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py
index d7c9707..2346d2d 100644
--- a/morphlib/sourceresolver.py
+++ b/morphlib/sourceresolver.py
@@ -374,6 +374,10 @@ class SourceResolver(object):
morphology = self._get_morphology(resolved_morphologies,
definitions_checkout_dir,
morph_loader, filename)
+
+ if morphology['name'] != chunk_name:
+ warnings.warn("Name '%s' doesn't match '%s in morpholgy: %s"
+ % (morphology['name'], chunk_name, filename))
else:
# Chunk uses one of the predefined build systems. In this case
# 'filename' will be faked (name of chunk + '.morph').
diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn
index 8f4c383..45bb205 100644
--- a/yarns/implementations.yarn
+++ b/yarns/implementations.yarn
@@ -854,7 +854,7 @@ Implementations for building systems
cd "$DATADIR"/definitions
git checkout "$branch"
cat << EOF > "${chunk_name}".morph
- name: hello
+ name: "${chunk_name}"
kind: chunk
configure-commands:
- echo dummy configure