summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-06-30 11:29:40 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-06-30 11:29:51 +0000
commit44e6c7b0f1a7edc7e0b4c79121632ef61fb1dd53 (patch)
treeaa55c59293ff129ea3503d604ca8cdf478bece7d
parentf4727faa9490fe878132facebff1f6622f0817ad (diff)
downloadmorph-44e6c7b0f1a7edc7e0b4c79121632ef61fb1dd53.tar.gz
Use the correct repo and ref based on whether the chunk morphology is from definitions
-rw-r--r--morphlib/artifactresolver.py13
-rw-r--r--morphlib/buildcommand.py8
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))