]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: Add $DESTDIR support to meson-install-web.py
authorAndrea Bolognani <abologna@redhat.com>
Wed, 10 Aug 2022 16:06:24 +0000 (18:06 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 11 Aug 2022 12:01:55 +0000 (14:01 +0200)
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>
scripts/meson-install-web.py

index a03f8523cd926cfee1cf2df4994328f8b0d08325..086d465ae454a1f2665eab58179f512dd0cfb4f8 100755 (executable)
@@ -4,7 +4,11 @@ import os
 import shutil
 import sys
 
+destdir = os.environ.get('DESTDIR', os.sep)
+
 for desc in sys.argv[1:]:
     inst = desc.split(':')
-    os.makedirs(inst[1], exist_ok=True)
-    shutil.copy(inst[0], inst[1])
+    src = inst[0]
+    dst = os.path.join(destdir, inst[1].strip(os.sep))
+    os.makedirs(dst, exist_ok=True)
+    shutil.copy(src, dst)