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).
This commit is contained in:
Peter Scheibel 2019-08-30 10:33:18 -07:00 committed by GitHub
parent 0c421589e6
commit 9432d4c7ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)