diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-04-29 01:34:56 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-04-29 18:55:17 +0300 |
commit | c5d2299caca3f3ca9b8e568c6b6045aed2f00124 (patch) | |
tree | 8bafc6b1427063c0983c86f7ea3281b91fa6a686 /mesonbuild/msetup.py | |
parent | 6e794c380ba2febe67f563c3388797b8b4482f82 (diff) | |
download | meson-c5d2299caca3f3ca9b8e568c6b6045aed2f00124.zip meson-c5d2299caca3f3ca9b8e568c6b6045aed2f00124.tar.gz meson-c5d2299caca3f3ca9b8e568c6b6045aed2f00124.tar.bz2 |
Fix symlink deletion with --wipe option
When wiping a build tree with --wipe, every entry in the build directory
is removed with mesonlib.windows_proof_rmtree() for directories and
mesonlib.windows_proof_rm() for other files. Symlinks to directories are
considered directories, resulting in the former being called. This
causes an exception to be raised, as the implementation calls
shutil.rmtree(), which isn't allowed on symlinks.
Fix this by using mesonlib.windows_proof_rm() for symlinks.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'mesonbuild/msetup.py')
-rw-r--r-- | mesonbuild/msetup.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 77d8377..2521511 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -86,7 +86,7 @@ class MesonApp: # will cause a crash for l in os.listdir(self.build_dir): l = os.path.join(self.build_dir, l) - if os.path.isdir(l): + if os.path.isdir(l) and not os.path.islink(l): mesonlib.windows_proof_rmtree(l) else: mesonlib.windows_proof_rm(l) |