mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25:25 +00:00
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 <eskultet@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
2edd63a0db
commit
3a29b2fb79
@ -12,4 +12,8 @@ workdir = os.path.join(destdir, dirname.strip(os.sep))
|
||||
|
||||
os.makedirs(workdir, exist_ok=True)
|
||||
os.chdir(workdir)
|
||||
|
||||
if os.path.exists(link):
|
||||
os.remove(link)
|
||||
|
||||
os.symlink(target, link)
|
||||
|
Loading…
Reference in New Issue
Block a user