From: Martin Kletzander Date: Mon, 12 Jun 2023 07:49:33 +0000 (+0200) Subject: meson-dist: Use shutil.copy for copying a file X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e31ac985f5ab17ff8aa615ac316ad0fd64e3fbe3;p=libvirt.git meson-dist: Use shutil.copy for copying a file Using os.system("cp {0} {1}".format(...)) has two issues, it does not work on Windows, but more importantly it can cause issues in case one of the directories has a space in it. Signed-off-by: Martin Kletzander Reviewed-by: Michal Privoznik --- diff --git a/scripts/meson-dist.py b/scripts/meson-dist.py index a1d36c2533..1c2364f6b6 100755 --- a/scripts/meson-dist.py +++ b/scripts/meson-dist.py @@ -2,13 +2,12 @@ import os import sys +import shutil meson_build_root = sys.argv[1] file_name = sys.argv[2] meson_dist_root = os.environ['MESON_DIST_ROOT'] -os.system('cp {0} {1}'.format( - os.path.join(meson_build_root, file_name), - os.path.join(meson_dist_root, file_name) -)) +shutil.copy(os.path.join(meson_build_root, file_name), + os.path.join(meson_dist_root, file_name))