Use shutil.copy2 in install_tree (#15058)
Sometimes one needs to preserve the (relative order) of mtimes on installed files. So it's better to just copy over all the metadata from the source tree to the install tree. If permissions need fixing, that will be done anyway afterwards. One major use case are resource()s: They're unpacked in one place and then copied to their final place using install_tree(). If the resource is a source tree using autoconf/automake, resetting mtimes uncorrectly might force unwanted autoconf/etc calls.
This commit is contained in:
parent
a47ab9c6b2
commit
22a56a89c7
@ -456,7 +456,7 @@ def copy_tree(src, dest, symlinks=True, ignore=None, _permissions=False):
|
||||
if os.path.isdir(s):
|
||||
mkdirp(d)
|
||||
else:
|
||||
shutil.copyfile(s, d)
|
||||
shutil.copy2(s, d)
|
||||
|
||||
if _permissions:
|
||||
set_install_permissions(d)
|
||||
|
Loading…
Reference in New Issue
Block a user