diff options
author | Dr. Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com> | 2020-02-20 06:09:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 23:09:26 -0600 |
commit | 22a56a89c7814b3e7386fa01528a58fe91ea3a4f (patch) | |
tree | 68e3f7c5090fb98ef176adf9d83beb953cb904b6 /lib | |
parent | a47ab9c6b216e4926a5cc4564a7db24379354fb4 (diff) | |
download | spack-22a56a89c7814b3e7386fa01528a58fe91ea3a4f.tar.gz spack-22a56a89c7814b3e7386fa01528a58fe91ea3a4f.tar.bz2 spack-22a56a89c7814b3e7386fa01528a58fe91ea3a4f.tar.xz spack-22a56a89c7814b3e7386fa01528a58fe91ea3a4f.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/llnl/util/filesystem.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 273840a424..b4bb23d444 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -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) |