mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-12-08 08:24:23 +03:00
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>
20 lines
335 B
Python
Executable File
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)
|