stage.steal_source: preserve symlinks

This avoids dangling symlink errors. ignore_dangling_symlinks option would be more-targeted but is only available for Python >= 3.2 (#28318)
This commit is contained in:
Peter Scheibel 2022-01-10 10:10:49 -08:00 committed by Harmen Stoppels
parent f333b7de4e
commit fbfd56d07e

View File

@ -533,7 +533,7 @@ def steal_source(self, dest):
for entry in hidden_entries + entries:
if os.path.isdir(entry):
d = os.path.join(dest, os.path.basename(entry))
shutil.copytree(entry, d)
shutil.copytree(entry, d, symlinks=True)
else:
shutil.copy2(entry, dest)