Skip to content

Commit 3a29b2f

Browse files
committed
scripts: Fix meson-install-symlink.py overwriting existing links
By default, symlink re-creation fails if the link already exists, more specifically in case of meson-install-symlink.py: Traceback (most recent call last): File "/<path_to_libvirt_repo>/scripts/meson-install-symlink.py", line 15, in <module> os.symlink(target, link) FileExistsError: File exists: '../default.xml' -> 'default.xml' Unfortunately, Python can't mimic "ln -sf", so we have to fix this differently - remove the existing link first and then try re-creating it. Signed-off-by: Erik Skultety <[email protected]> Reviewed-by: Pavel Hrdina <[email protected]>
1 parent 2edd63a commit 3a29b2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/meson-install-symlink.py

+4
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212

1313
os.makedirs(workdir, exist_ok=True)
1414
os.chdir(workdir)
15+
16+
if os.path.exists(link):
17+
os.remove(link)
18+
1519
os.symlink(target, link)

0 commit comments

Comments
 (0)