summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/binutils
diff options
context:
space:
mode:
authorGlenn Johnson <glenn-johnson@uiowa.edu>2022-02-24 19:52:45 -0600
committerGitHub <noreply@github.com>2022-02-24 17:52:45 -0800
commitc6556b7a06eea1d3c1aacc66cb0601c9c064ab3e (patch)
tree7e938061ab9ee9d8f61d2d7047a027f82b886cb5 /var/spack/repos/builtin/packages/binutils
parent31c856700731553e236eefac8fb119fa5b098546 (diff)
downloadspack-c6556b7a06eea1d3c1aacc66cb0601c9c064ab3e.tar.gz
spack-c6556b7a06eea1d3c1aacc66cb0601c9c064ab3e.tar.bz2
spack-c6556b7a06eea1d3c1aacc66cb0601c9c064ab3e.tar.xz
spack-c6556b7a06eea1d3c1aacc66cb0601c9c064ab3e.zip
Adjust binutils detection (#29188)
The `spack external find binutils` command was failing to find my system binutils because the regex was not matching. The name of the executable follows the string 'GNU' that I tested with three different installations so I changed the regex to look for that. On my CentOS-7 system, the version had the RPM details so I set the version to capture the first three parts of the version.
Diffstat (limited to 'var/spack/repos/builtin/packages/binutils')
-rw-r--r--var/spack/repos/builtin/packages/binutils/package.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
index c7ead04571..ea937d82dd 100644
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -89,8 +89,8 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str, error=str)
- match = re.search(r'GNU Binutils.*\) (\S+)', output)
- return match.group(1) if match else None
+ match = re.search(r'GNU (nm|readelf).* (\S+)', output)
+ return Version(match.group(2)).dotted.up_to(3) if match else None
def setup_build_environment(self, env):