From c1aa6a47e792cfa61b67eccee401fcb77cd57591 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Sat, 13 Feb 2016 13:05:22 +0000 Subject: 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 --- morphlib/sourceresolver.py | 4 ++++ yarns/implementations.yarn | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py index d7c9707a..2346d2d6 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 -- cgit v1.2.1