diff options
author | iarspider <iarspider@gmail.com> | 2022-10-24 23:32:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 23:32:46 +0200 |
commit | e7512bcb7b784d96388bbc333769479ca657b372 (patch) | |
tree | 54679145328f64a01c29d4f2482b73507b3ec4fe /var | |
parent | 20492fa48e22f7a4322bd88b199d02e091045944 (diff) | |
download | spack-e7512bcb7b784d96388bbc333769479ca657b372.tar.gz spack-e7512bcb7b784d96388bbc333769479ca657b372.tar.bz2 spack-e7512bcb7b784d96388bbc333769479ca657b372.tar.xz spack-e7512bcb7b784d96388bbc333769479ca657b372.zip |
Add filename to text_to_relocate only if it needs to be relocated (#31074)
Scan the text files for relocatable prefixes *before* creating a tarball,
to reduce the amount of work to be done during install from binary
cache.
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/needs-text-relocation/package.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/needs-text-relocation/package.py b/var/spack/repos/builtin.mock/packages/needs-text-relocation/package.py new file mode 100644 index 0000000000..9b2654dd83 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/needs-text-relocation/package.py @@ -0,0 +1,27 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +class NeedsTextRelocation(Package): + """A dumy package that encodes its prefix.""" + + homepage = "https://www.cmake.org" + url = "https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz" + + version("0.0.0", "12345678qwertyuiasdfghjkzxcvbnm0") + + def install(self, spec, prefix): + mkdirp(prefix.bin) + + exe = join_path(prefix.bin, "exe") + with open(exe, "w") as f: + f.write(prefix) + set_executable(exe) + + otherexe = join_path(prefix.bin, "otherexe") + with open(otherexe, "w") as f: + f.write("Lorem Ipsum") + set_executable(otherexe) |