summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorscheibelp <scheibel1@llnl.gov>2018-03-09 10:03:58 -0800
committerGitHub <noreply@github.com>2018-03-09 10:03:58 -0800
commitf27f20e5b31797164658aeb7054f6f172b1d5d70 (patch)
treefa2beb4485a2ad3f240ea26183328162a416cc59 /lib
parent869c654c37529b61b052148d2415295cb1ccd5df (diff)
downloadspack-f27f20e5b31797164658aeb7054f6f172b1d5d70.tar.gz
spack-f27f20e5b31797164658aeb7054f6f172b1d5d70.tar.bz2
spack-f27f20e5b31797164658aeb7054f6f172b1d5d70.tar.xz
spack-f27f20e5b31797164658aeb7054f6f172b1d5d70.zip
replace dash with underscore in os name/version (#7381)
Fixes #7356 In some cases OperatingSystem (e.g. LinuxDistro) was getting instantiated with a version that contains dashes. This breaks because the concretizer later converts this value to a string and re-parses it, and the '-' character is used to separate architecture components. This adds a guard in the initializer to convert '-' to '_'.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index 62e2619d7f..fad6896387 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -240,8 +240,8 @@ class OperatingSystem(object):
"""
def __init__(self, name, version):
- self.name = name
- self.version = version
+ self.name = name.replace('-', '_')
+ self.version = str(version).replace('-', '_')
def __str__(self):
return "%s%s" % (self.name, self.version)