[libvirt PATCH v2 1/2] scripts: Add $DESTDIR support to meson-install-web.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 scripts/meson-install-web.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py
index a03f8523cd..086d465ae4 100755
--- a/scripts/meson-install-web.py
+++ b/scripts/meson-install-web.py
@@ -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)
-- 
2.37.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux