From 44e6c7b0f1a7edc7e0b4c79121632ef61fb1dd53 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Mon, 30 Jun 2014 11:29:40 +0000 Subject: Use the correct repo and ref based on whether the chunk morphology is from definitions --- morphlib/artifactresolver.py | 13 ++++++++++--- morphlib/buildcommand.py | 8 ++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py index c18042a3..db85ec8a 100644 --- a/morphlib/artifactresolver.py +++ b/morphlib/artifactresolver.py @@ -191,10 +191,17 @@ class ArtifactResolver(object): name_to_processed_artifacts = {} for info in source.morphology['chunks']: + filename = morphlib.util.sanitise_morphology_path(info['morph']) + if info['morph'] == filename: + repo = source.repo_name + ref = source.original_ref + else: + repo = info['repo'] + ref = info['ref'] chunk_source = self._source_pool.lookup( - info['repo'], - info['ref'], - morphlib.util.sanitise_morphology_path(info['morph'])) + repo, + ref, + filename) chunk_name = chunk_source.morphology['name'] diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 45c6ef00..72fe3d8d 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -229,9 +229,13 @@ class BuildCommand(object): def _validate_cross_refs_for_xxx(self, src, srcpool, specs, wanted): for spec in specs: - repo_name = spec.get('repo') or src.repo_name - ref = spec.get('ref') or src.original_ref filename = morphlib.util.sanitise_morphology_path(spec['morph']) + if spec['morph'] == filename: + repo_name = src.repo_name + ref = src.original_ref + else: + repo_name = spec.get('repo') or src.repo_name + ref = spec.get('ref') or src.original_ref logging.debug( 'Validating cross ref to %s:%s:%s' % (repo_name, ref, filename)) -- cgit v1.2.1