aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-08-12 23:33:15 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-08-12 23:33:15 +0300
commit84a31d0b57a928a1596f4e41f6ad2b39babbc960 (patch)
tree04310a83939ee89a5aa2b04049e0d8b3947747b4
parentef788a31ce84e4b612e0d7ce51f5d178d60308a4 (diff)
downloadmeson-84a31d0b57a928a1596f4e41f6ad2b39babbc960.zip
meson-84a31d0b57a928a1596f4e41f6ad2b39babbc960.tar.gz
meson-84a31d0b57a928a1596f4e41f6ad2b39babbc960.tar.bz2
Delete old symlink before creating new because symlink creation does not overwrite the old one.
-rwxr-xr-xmeson_install.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meson_install.py b/meson_install.py
index 18b0a20..c353949 100755
--- a/meson_install.py
+++ b/meson_install.py
@@ -165,7 +165,12 @@ def install_targets(d):
printed_symlink_error = False
for alias in aliases:
try:
- os.symlink(fname, os.path.join(outdir, alias))
+ symlinkfilename = os.path.join(outdir, alias)
+ try:
+ os.unlink(symlinkfilename)
+ except FileNotFoundError:
+ pass
+ os.symlink(fname, symlinkfilename)
except NotImplementedError:
if not printed_symlink_error:
print("Symlink creation does not work on this platform.")