From 535443bcfa78568ecdd091a57e4aff64bfbf9638 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Sat, 13 Feb 2016 03:18:17 +0000 Subject: sourceresolver: Use real name for sources without chunk file The filename was being used instead. I noticed this bug after seeing cache artifacts named like: de31c7bcac0240315bc4e0994b34f3757d37d35e4179cdbe0a8b2e60e26449f8.chunk.xorg-proto-x11proto.morph-bins de7b9f6f7a10b8dc04b52a08e74987df7da310b59dc25c6cf083b0381726e15f.chunk.networkx.morph-bins def910ed756be94c626d59d73f0770a445d62278a2eb46e031af42563691c6ed.chunk.pv.morph-bins e003da7f8c697286fa4d550299920160a6e76df449b7e434b270cd760c0c9304.chunk.cython.morph-bins e193576471c957387c9684c385a8c03db1e70618890210f6272c362ccc3e259b.chunk.xorg-proto-xcmiscproto.morph-bins e3b0b0dbb7b3de4bb8c72cd064408956296e290fc4b56acbbee241e2d78bf533.chunk.greenlet.morph-bins e3f09aa095e5839aa9bf7774720951c8b03d78300b056f7bbdeacdf4c5d5944d.chunk.libvorbis.morph-bins e437810247200713da17937181cc914e080ac7d6030451ccfaa86ddccf7a395b.chunk.python-requests.morph-bins e4b7de417c5691794f4ad6a6481cacc16242af072db39bcadede6ca2bf48241e.chunk.flac.morph-bins e4f1e6dbaeed869b445f9b45b98033b6e6a2952674b76b8465e40a67e675333c.chunk.Sub-Name.morph-bins Change-Id: I8a8697a12cf7e4c7891c93e4f774819fe2f8ea86 --- morphlib/sourceresolver.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'morphlib') diff --git a/morphlib/sourceresolver.py b/morphlib/sourceresolver.py index 4f6d38ea..ce395645 100644 --- a/morphlib/sourceresolver.py +++ b/morphlib/sourceresolver.py @@ -341,14 +341,15 @@ class SourceResolver(object): raise MorphologyReferenceNotFoundError( path, filename) - chunk_queue.add((c['repo'], c['ref'], path, None)) + chunk_queue.add((c['name'], c['repo'], c['ref'], + path, None)) else: # We invent a filename here, so that the rest of the # Morph code doesn't need to know about the predefined # build instructions. - chunk_name = c['name'] + '.morph' - chunk_queue.add((c['repo'], c['ref'], chunk_name, - c['build-system'])) + chunk_filename = c['name'] + '.morph' + chunk_queue.add((c["name"], c['repo'], c['ref'], + chunk_filename, c['build-system'])) return chunk_queue @@ -361,9 +362,9 @@ class SourceResolver(object): return morph def process_chunk(self, resolved_morphologies, resolved_trees, - definitions_checkout_dir, morph_loader, chunk_repo, - chunk_ref, filename, chunk_buildsystem, visit, - predefined_build_systems, predefined_split_rules): + definitions_checkout_dir, morph_loader, chunk_name, + chunk_repo, chunk_ref, filename, chunk_buildsystem, + visit, predefined_build_systems, predefined_split_rules): absref, tree = self._resolve_ref(resolved_trees, chunk_repo, chunk_ref) if chunk_buildsystem is None: @@ -384,7 +385,7 @@ class SourceResolver(object): (filename, chunk_buildsystem)) morphology = self._create_morphology_for_build_system( - morph_loader, buildsystem, filename) + morph_loader, buildsystem, chunk_name) visit(chunk_repo, chunk_ref, filename, absref, tree, morphology, predefined_split_rules) @@ -435,11 +436,11 @@ class SourceResolver(object): predefined_split_rules) # Now process all the chunks involved in the build. - for repo, ref, filename, buildsystem in chunk_queue: + for name, repo, ref, filename, buildsystem in chunk_queue: self.process_chunk(resolved_morphologies, resolved_trees, definitions_checkout_dir, morph_loader, - repo, ref, filename, buildsystem, visit, - predefined_build_systems, + name, repo, ref, filename, buildsystem, + visit, predefined_build_systems, predefined_split_rules) class DuplicateChunkError(morphlib.Error): -- cgit v1.2.1