Skip to content

Commit ca551e6

Browse files
committed
[GR-2798] Use smart copying in the release mx task.
PullRequest: fastr/2419
2 parents 2f4d81a + 9ae9bf2 commit ca551e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mx.fastr/mx_fastr_dists.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
import mx_sdk
2525
import os, string, shutil
2626
from os.path import join, basename, isfile
27+
import distutils
28+
# for some reason the script fails without this import:
29+
from distutils import dir_util # pylint: disable=unused-import,no-name-in-module
2730

2831
_fastr_suite = mx.suite('fastr')
2932

@@ -81,9 +84,7 @@ def build(self):
8184
fastr_dir = _fastr_suite.dir
8285
for d in ['bin', 'include', 'library', 'etc', 'share', 'doc']:
8386
target_dir = join(output_dir, d)
84-
if os.path.exists(target_dir):
85-
shutil.rmtree(target_dir)
86-
shutil.copytree(join(fastr_dir, d), target_dir)
87+
distutils.dir_util.copy_tree(join(fastr_dir, d), target_dir, update=True)
8788

8889
lib_fastr_dir = join(fastr_dir, 'lib')
8990
lib_output_dir = join(output_dir, 'lib')

0 commit comments

Comments
 (0)