aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/msubprojects.py
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2021-06-21 17:45:08 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2021-07-03 13:14:20 +0300
commitf21685a83330a4bbe1e59c3641a0d24f1efe8825 (patch)
treec5a25643159ec7058283895ebf77c01d6b1f998f /mesonbuild/msubprojects.py
parent6f3f43bb2d31797b0f3128e1664652571fe314e6 (diff)
downloadmeson-f21685a83330a4bbe1e59c3641a0d24f1efe8825.zip
meson-f21685a83330a4bbe1e59c3641a0d24f1efe8825.tar.gz
meson-f21685a83330a4bbe1e59c3641a0d24f1efe8825.tar.bz2
Delete redirected wrap files in subprojects purge
We need to store the original filename as well as whether the wrap was redirected in order to properly purge the redirected wrap.
Diffstat (limited to 'mesonbuild/msubprojects.py')
-rwxr-xr-xmesonbuild/msubprojects.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 63ea98a..5d1fb72 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -386,6 +386,12 @@ class Runner:
if not self.wrap.type:
return True
+ if self.wrap.redirected:
+ redirect_file = Path(self.wrap.original_filename).resolve()
+ if self.options.confirm:
+ redirect_file.unlink()
+ mlog.log(f'Deleting {redirect_file}')
+
if self.wrap.type == 'redirect':
redirect_file = Path(self.wrap.filename).resolve()
if self.options.confirm:
@@ -416,7 +422,7 @@ class Runner:
# parallelized, another thread could have deleted it already.
try:
if not any(packagecache.iterdir()):
- packagecache.rmdir()
+ windows_proof_rmtree(str(packagecache))
except FileNotFoundError:
pass