summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-09-28 11:27:24 -0400
committerMike Frysinger <vapier@google.com>2021-09-28 16:06:50 +0000
commit9d96f58f5fcec101c612e61c3e2526ca071d89ea (patch)
tree63bc9e73e3b7d74a2cf5352239bf4f2e9695b507 /manifest_xml.py
parent7a1e7e772f3bbc67660e824c98f527b5f608ac24 (diff)
downloadgit-repo-9d96f58f5fcec101c612e61c3e2526ca071d89ea.tar.gz
make file removal a bit more robust
Some of the file removal calls are subject to race conditions (if something else deletes the file), so extend our remove API to have an option to ignore ENOENT errors. Then update a bunch of random call sites to use this new functionality. Change-Id: I31a9090e135452033135337a202a4fc2dbf8b63c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319195 Reviewed-by: Sean McAllister <smcallis@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 135c91fb..86f20202 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -270,8 +270,7 @@ class XmlManifest(object):
270 self.Override(name) 270 self.Override(name)
271 271
272 # Old versions of repo would generate symlinks we need to clean up. 272 # Old versions of repo would generate symlinks we need to clean up.
273 if os.path.lexists(self.manifestFile): 273 platform_utils.remove(self.manifestFile, missing_ok=True)
274 platform_utils.remove(self.manifestFile)
275 # This file is interpreted as if it existed inside the manifest repo. 274 # This file is interpreted as if it existed inside the manifest repo.
276 # That allows us to use <include> with the relative file name. 275 # That allows us to use <include> with the relative file name.
277 with open(self.manifestFile, 'w') as fp: 276 with open(self.manifestFile, 'w') as fp: