summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-05-04 12:09:04 +0200
committerValentin David <valentin.david@codethink.co.uk>2018-05-04 12:09:04 +0200
commit92178a796c092cc54a55771583882bb0c02a2e2d (patch)
treeb5f7cce3065e2ed3b1165bed626d0165572da7e4
parent00bb839a17e52fb8a7fc741d430970caa9c81200 (diff)
downloadbuildstream-valentindavid/etag.tar.gz
buildstream/plugins/sources/_downloadablefilesource.py: Write atomically in etag cache filevalentindavid/etag
-rw-r--r--buildstream/plugins/sources/_downloadablefilesource.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/plugins/sources/_downloadablefilesource.py b/buildstream/plugins/sources/_downloadablefilesource.py
index 64efd4634..c0dc4966d 100644
--- a/buildstream/plugins/sources/_downloadablefilesource.py
+++ b/buildstream/plugins/sources/_downloadablefilesource.py
@@ -97,7 +97,7 @@ class DownloadableFileSource(Source):
def _store_etag(self, ref, etag):
etagfilename = os.path.join(self._get_mirror_dir(), '{}.etag'.format(ref))
- with open(etagfilename, 'w') as etagfile:
+ with utils.save_file_atomic(etagfilename) as etagfile:
etagfile.write(etag)
def _ensure_mirror(self):