west: sign: clean any stale rimage output

We never want to leave stale outputs behind after failing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2023-03-03 01:44:35 +00:00 committed by Anas Nashif
parent 5bdb1467cf
commit 5c4319d54f

View file

@ -442,6 +442,11 @@ class RimageSigner(Signer):
out_xman = str(b / 'zephyr' / 'zephyr.ri.xman')
out_tmp = str(b / 'zephyr' / 'zephyr.rix')
# Clean any stale output. This is especially important when using --if-tool-available
# (but not just)
for o in [ out_bin, out_xman, out_tmp ]:
pathlib.Path(o).unlink(missing_ok=True)
tool_path = (
args.tool_path if args.tool_path else
config_get(command.config, 'rimage.path', None)