moveconfig: Use a function to read files
authorSimon Glass <sjg@chromium.org>
Sat, 18 Dec 2021 21:54:34 +0000 (14:54 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 24 Jan 2022 22:36:30 +0000 (17:36 -0500)
commit37f815cad07d78bfa9ec99e6612344319dca8c3f
tree8ad42ad0fdebf5d0fc0d9ff65a4ace95f93dc32b
parent2fd85bd3263966dee1c4a913c457d1000a52de48
moveconfig: Use a function to read files

At present there is quite a bit of ad-hoc code reading from files. The
most common case is to read the file as lines. Put it in a function and
set the unicode encoding correctly.

Avoid writing back to a file when there are obviously no changes as this
speeds things up slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/moveconfig.py