diff options
author | Patrick Gartung <gartung@fnal.gov> | 2019-09-24 08:38:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 08:38:19 -0500 |
commit | 6dd9dbc07177b6ca424bd755b5f6a1030f7aedae (patch) | |
tree | f591cadd8e7826d84534d5692315b011a8332961 /lib | |
parent | 10d5e90e65e792d0fae3879dd5f512bdc7b95da6 (diff) | |
download | spack-6dd9dbc07177b6ca424bd755b5f6a1030f7aedae.tar.gz spack-6dd9dbc07177b6ca424bd755b5f6a1030f7aedae.tar.bz2 spack-6dd9dbc07177b6ca424bd755b5f6a1030f7aedae.tar.xz spack-6dd9dbc07177b6ca424bd755b5f6a1030f7aedae.zip |
Change get_patchelf to immediately return patchelf path if found (#12925)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/relocate.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 01fc913a0e..8873d1d725 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -66,20 +66,20 @@ def get_patchelf(): Returns the full patchelf binary path. """ # as we may need patchelf, find out where it is - if str(spack.architecture.platform()) == 'test': - return None - if str(spack.architecture.platform()) == 'darwin': - return None patchelf = spack.util.executable.which('patchelf') - if patchelf is None: + if patchelf is not None: + return patchelf.path + else: + if str(spack.architecture.platform()) == 'test': + return None + if str(spack.architecture.platform()) == 'darwin': + return None patchelf_spec = spack.cmd.parse_specs("patchelf", concretize=True)[0] patchelf = spack.repo.get(patchelf_spec) if not patchelf.installed: patchelf.do_install(use_cache=False) patchelf_executable = os.path.join(patchelf.prefix.bin, "patchelf") return patchelf_executable - else: - return patchelf.path def get_existing_elf_rpaths(path_name): |