summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-02-13 13:05:22 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-02-19 00:08:26 +0000
commitfc0b420549a7e0cff0df0b62ba975325bbf9b6c2 (patch)
treee6edb3d2c3d310a2c1237e60db84d32445ceb738
parent535443bcfa78568ecdd091a57e4aff64bfbf9638 (diff)
downloadmorph-fc0b420549a7e0cff0df0b62ba975325bbf9b6c2.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 ce395645..80f8e25b 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 8f4c3837..45bb2058 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