diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2016-04-10 18:27:02 +0100 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2016-04-10 18:34:53 +0100 |
commit | 401aad76b852d22fefc896718e6520a52f69a64d (patch) | |
tree | 2a9777b54e802a3e25b05753fee63183e11bda9b /migrations | |
parent | 76833a2578c9830160486d011f7791ed8f763276 (diff) | |
download | spec-401aad76b852d22fefc896718e6520a52f69a64d.tar.gz |
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
<module>
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
Diffstat (limited to 'migrations')
-rwxr-xr-x | migrations/006-specify-build-system.py | 7 |
1 files 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 |