llvm_tools: Add atomic_write to patch_utils.py This allows a utility function which can write to an arbitrary file without risking an incomplete write error, causing issues and creating an invalid edit. This function ensures that the file is only swapped if the file write was successful, otherwise the file is deleted. BUG=None TEST=./patch_utils_unittest.py Change-Id: Iedc3297b0e59d216f027e6ff125f92bc4d088c7d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3685569 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
toolchain-utilsVarious utilities used by the ChromeOS toolchain team.
To run Python scripts in this directory, first run:
export PYTHONPATH=$(readlink -f .):$PYTHONPATH
from this directory.
Then you can run any script.
To get help on any script, type in python <script> --help, or refer to the header of the script for more information.