1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00
libvirt/scripts/meson-install-web.py
Andrea Bolognani 03ba5f68b8 scripts: Add $DESTDIR support to meson-install-web.py
meson already supports $DESTDIR natively, but in this case
we're using a custom script and so we have to do some extra
work ourselves.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-08-11 14:01:55 +02:00

15 lines
293 B
Python
Executable File

#!/usr/bin/env python3
import os
import shutil
import sys
destdir = os.environ.get('DESTDIR', os.sep)
for desc in sys.argv[1:]:
inst = desc.split(':')
src = inst[0]
dst = os.path.join(destdir, inst[1].strip(os.sep))
os.makedirs(dst, exist_ok=True)
shutil.copy(src, dst)