From 84a31d0b57a928a1596f4e41f6ad2b39babbc960 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 12 Aug 2014 23:33:15 +0300 Subject: Delete old symlink before creating new because symlink creation does not overwrite the old one. --- meson_install.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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.") -- cgit v1.1