From f27f20e5b31797164658aeb7054f6f172b1d5d70 Mon Sep 17 00:00:00 2001 From: scheibelp Date: Fri, 9 Mar 2018 10:03:58 -0800 Subject: 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 '_'. --- lib/spack/spack/architecture.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3-70-g09d2