From 9432d4c7eef277ceec4040483c8eac90614ec8fd Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 30 Aug 2019 10:33:18 -0700 Subject: [PATCH] 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). --- lib/spack/spack/repo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 errno import functools import inspect +import itertools import os import re import shutil @@ -921,7 +922,9 @@ def dump_provenance(self, spec, path): # 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)