mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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 <mkletzan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2ed41d7cd9
commit
e31ac985f5
@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
|
|
||||||
meson_build_root = sys.argv[1]
|
meson_build_root = sys.argv[1]
|
||||||
file_name = sys.argv[2]
|
file_name = sys.argv[2]
|
||||||
|
|
||||||
meson_dist_root = os.environ['MESON_DIST_ROOT']
|
meson_dist_root = os.environ['MESON_DIST_ROOT']
|
||||||
|
|
||||||
os.system('cp {0} {1}'.format(
|
shutil.copy(os.path.join(meson_build_root, file_name),
|
||||||
os.path.join(meson_build_root, file_name),
|
os.path.join(meson_dist_root, file_name))
|
||||||
os.path.join(meson_dist_root, file_name)
|
|
||||||
))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user