1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-12-08 08:24:23 +03:00
Files
libvirt/scripts/meson-install-symlink.py
Daniel P. Berrangé cb3a6e8806 scripts: add execute permission to several files
Most, but not all, files in scripts have execute permission. While we
don't need this in order to launch them via meson/ninja build rules,
it is nice to direct execution if they have execution permission. This
makes the practice consistent across all scripts.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-03-17 11:35:54 +00:00

20 lines
335 B
Python
Executable File

#!/usr/bin/env python3
import os
import sys
destdir = os.environ.get('DESTDIR', os.sep)
dirname = sys.argv[1]
target = sys.argv[2]
link = sys.argv[3]
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)