aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-05-15 23:27:42 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-05-21 00:48:25 +0300
commite3be7f7021e6fe39509460f1187007ce4c2d1681 (patch)
tree90c412184a5540c69b1f8cf6f853e91d2ce48cd9 /mesonbuild/mesonmain.py
parent7e8c099387ffcdfbdc55e3ef550cf7e8ab0e848d (diff)
downloadmeson-e3be7f7021e6fe39509460f1187007ce4c2d1681.zip
meson-e3be7f7021e6fe39509460f1187007ce4c2d1681.tar.gz
meson-e3be7f7021e6fe39509460f1187007ce4c2d1681.tar.bz2
Write coredata transactionally. Closes #3511.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 2b6281d..82f5031 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -204,7 +204,11 @@ class MesonApp:
g.run_postconf_scripts()
except:
if 'cdf' in locals():
- os.unlink(cdf)
+ old_cdf = cdf + '.prev'
+ if os.path.exists(old_cdf):
+ os.replace(old_cdf, cdf)
+ else:
+ os.unlink(cdf)
raise
def run_script_command(args):