[libvirt PATCH v2] scripts: Fix meson-install-symlink.py overwriting existing links

Pavel Hrdina phrdina at redhat.com
Wed Aug 5 09:26:18 UTC 2020


On Wed, Aug 05, 2020 at 11:06:29AM +0200, Erik Skultety wrote:
> 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 at redhat.com>
> ---
> 
> This version suffers from the same problem as v1, but I didn't bother putting
> that into the commit message anymore as the consensus seems to be that we don't
> care.
> 
>  scripts/meson-install-symlink.py | 4 ++++
>  1 file changed, 4 insertions(+)

I guess this is good enough.

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200805/0f4530df/attachment-0001.sig>


More information about the libvir-list mailing list