Merge pull request #91159 from akien-mga/3.x-mono-replace-distutils-shutils

[3.x] Mono: Replace distutils function with shutil equivalent
This commit is contained in:
Rémi Verschelde 2024-04-25 16:23:33 +02:00 committed by GitHub
commit 06ddcbbe4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -476,9 +476,8 @@ def copy_mono_root_files(env, mono_root, mono_bcl):
def copy_mono_etc_dir(mono_root, target_mono_config_dir, platform): def copy_mono_etc_dir(mono_root, target_mono_config_dir, platform):
from distutils.dir_util import copy_tree
from glob import glob from glob import glob
from shutil import copy from shutil import copy, copytree
if not os.path.isdir(target_mono_config_dir): if not os.path.isdir(target_mono_config_dir):
os.makedirs(target_mono_config_dir) os.makedirs(target_mono_config_dir)
@ -498,11 +497,11 @@ def copy_mono_etc_dir(mono_root, target_mono_config_dir, platform):
if not mono_etc_dir: if not mono_etc_dir:
raise RuntimeError("Mono installation etc directory not found") raise RuntimeError("Mono installation etc directory not found")
copy_tree(os.path.join(mono_etc_dir, "2.0"), os.path.join(target_mono_config_dir, "2.0")) copytree(os.path.join(mono_etc_dir, "2.0"), os.path.join(target_mono_config_dir, "2.0"))
copy_tree(os.path.join(mono_etc_dir, "4.0"), os.path.join(target_mono_config_dir, "4.0")) copytree(os.path.join(mono_etc_dir, "4.0"), os.path.join(target_mono_config_dir, "4.0"))
copy_tree(os.path.join(mono_etc_dir, "4.5"), os.path.join(target_mono_config_dir, "4.5")) copytree(os.path.join(mono_etc_dir, "4.5"), os.path.join(target_mono_config_dir, "4.5"))
if os.path.isdir(os.path.join(mono_etc_dir, "mconfig")): if os.path.isdir(os.path.join(mono_etc_dir, "mconfig")):
copy_tree(os.path.join(mono_etc_dir, "mconfig"), os.path.join(target_mono_config_dir, "mconfig")) copytree(os.path.join(mono_etc_dir, "mconfig"), os.path.join(target_mono_config_dir, "mconfig"))
for file in glob(os.path.join(mono_etc_dir, "*")): for file in glob(os.path.join(mono_etc_dir, "*")):
if os.path.isfile(file): if os.path.isfile(file):