From 401aad76b852d22fefc896718e6520a52f69a64d Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Sun, 10 Apr 2016 18:27:02 +0100 Subject: migrations: Fix version 6 migration when build system isn't detected Turns this... ../spec/migrations/006-specify-build-system.py: Traceback (most recent call last): File "../spec/migrations/006-specify-build-system.py", line 340, in modify_cb=ensure_buildsystem_defined_where_needed) File "/home/sam/baserock/spec/migrations/migrations.py", line 220, in process_definitions changed = modify_cb(contents, filename) File "../spec/migrations/006-specify-build-system.py", line 327, in ensure_buildsystem_defined_where_needed chunk_ref['build-system'] = build_system.name AttributeError: 'NoneType' object has no attribute 'name' Into this: ../spec/migrations/006-specify-build-system.py: WARNING: Couldn't work out the build system of chunk Module-Build-Tiny WARNING: Couldn't work out the build system of chunk Params-Validate Change-Id: I9bc5408e6550303023abb839a45e6562306e4702 --- migrations/006-specify-build-system.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migrations/006-specify-build-system.py b/migrations/006-specify-build-system.py index b66736c..6ccecff 100755 --- a/migrations/006-specify-build-system.py +++ b/migrations/006-specify-build-system.py @@ -324,8 +324,11 @@ def ensure_buildsystem_defined_where_needed(contents, filename): '%s: got file list %s', chunk_git_url, toplevel_file_list) build_system = detect_build_system(toplevel_file_list) - chunk_ref['build-system'] = build_system.name - move_dict_entry_last(chunk_ref, 'build-depends') + if build_system: + chunk_ref['build-system'] = build_system.name + move_dict_entry_last(chunk_ref, 'build-depends') + else: + warnings.warn("Couldn't work out the build system of chunk %s" % chunk_ref.get('name')) changed = True -- cgit v1.2.1