summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2019-08-30 10:33:18 -0700
committerGitHub <noreply@github.com>2019-08-30 10:33:18 -0700
commit9432d4c7eef277ceec4040483c8eac90614ec8fd (patch)
treeeaf05648a5b43a991fea926734f1afafd19ab241
parent0c421589e61a7a671ac4d10adc9e923d079dc38c (diff)
downloadspack-9432d4c7eef277ceec4040483c8eac90614ec8fd.tar.gz
spack-9432d4c7eef277ceec4040483c8eac90614ec8fd.tar.bz2
spack-9432d4c7eef277ceec4040483c8eac90614ec8fd.tar.xz
spack-9432d4c7eef277ceec4040483c8eac90614ec8fd.zip
Archive all patches in a package after install (#12653)
When Spack installs a package it writes the package.py file and patches to a separate repository (which reflects the state of the package at the time it was installed). Previously, Spack only wrote patches that were used at installation time. This updates the archiving step to include all patch files that are relevant to the package (in case that repository is used in another context).
-rw-r--r--lib/spack/spack/repo.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py
index 6e4c0a2f49..d726fafacc 100644
--- a/lib/spack/spack/repo.py
+++ b/lib/spack/spack/repo.py
@@ -9,6 +9,7 @@ import contextlib
import errno
import functools
import inspect
+import itertools
import os
import re
import shutil
@@ -921,7 +922,9 @@ class Repo(object):
# Install patch files needed by the package.
mkdirp(path)
- for patch in spec.patches:
+ for patch in itertools.chain.from_iterable(
+ spec.package.patches.values()):
+
if patch.path:
if os.path.exists(patch.path):
install(patch.path, path)