]> code.ossystems Code Review - openembedded-core.git/commit
scripts: fix file writing in convert-variable-renames
authorScott Murray <scott.murray@konsulko.com>
Tue, 22 Feb 2022 04:21:38 +0000 (23:21 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Feb 2022 08:23:45 +0000 (08:23 +0000)
commit187ac1ea0a701a5ba9ec92f6aa32f2a67600a584
treeba017af20f932ef5e3756c4a968324acd2c780b7
parent4125d86f1d3adc53230c02bce4bab46b8c21116f
scripts: fix file writing in convert-variable-renames

In my test environments (Fedora 35 and Debian 10.10 on AMD 2970WX),
running the convert-variable-renames.py rename script was resulting
in empty files instead of updated ones.  From inspection, the new
files are never flushed/closed before moving them into place, which
seems inherently racy.  Adding an explicit close to flush the modified
contents out before moving into place fixes the issue for me.

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/convert-variable-renames.py