mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fix(manifest): correct px_mkfw shebang order and _merge_manifest logic
Move the shebang to line 1 so direct execution works on Linux; the vim modeline was sitting above it and silently breaking ./Tools/px_mkfw.py. Fix _merge_manifest to only merge dict values into dst["hardware"] when the key is "hardware". The previous structure ran the isinstance check unconditionally, so any dict-valued field in the fragment would have been shoved into dst["hardware"] regardless of its key, and could KeyError if a non-"hardware" dict arrived first. It only worked today because "hardware" happened to be the only dict in the fragment. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
parent
63f059fd47
commit
eacfab99cc
@ -1,5 +1,5 @@
|
||||
# vim: set noexpandtab tabstop=4 shiftwidth=4:
|
||||
#!/usr/bin/env python3
|
||||
# vim: set noexpandtab tabstop=4 shiftwidth=4:
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||
@ -72,10 +72,8 @@ def _merge_manifest(dst, src):
|
||||
if not isinstance(src, dict):
|
||||
return
|
||||
for k, v in src.items():
|
||||
if k == "hardware":
|
||||
dst.setdefault("hardware", {})
|
||||
if isinstance(v, dict):
|
||||
dst["hardware"].update(v)
|
||||
if k == "hardware" and isinstance(v, dict):
|
||||
dst.setdefault("hardware", {}).update(v)
|
||||
else:
|
||||
dst[k] = v
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user