From 189e8b3f349c8102772fa995fd8ee79df3c242c0 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Thu, 26 May 2016 13:17:01 -0700 Subject: fixed compiler config init logic --- lib/spack/spack/compilers/__init__.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index 8fe7a17116..ea79f655b0 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -102,15 +102,18 @@ def get_compiler_config(scope=None): # configured. Avoid updating automatically if there ARE site # compilers configured but no user ones. # if (isinstance(arch, basestring) or arch == my_arch) and arch not in config: - if scope is None: - # We know no compilers were configured in any scope. - init_compiler_config() - elif scope == 'user': - # Check the site config and update the user config if - # nothing is configured at the site level. - site_config = spack.config.get_config('compilers', scope='site') - if not site_config: + if not config: + if scope is None: + # We know no compilers were configured in any scope. init_compiler_config() + config = spack.config.get_config('compilers', scope=scope) + elif scope == 'user': + # Check the site config and update the user config if + # nothing is configured at the site level. + site_config = spack.config.get_config('compilers', scope='site') + if not site_config: + init_compiler_config() + config = spack.config.get_config('compilers', scope=scope) return config -- cgit v1.2.3-70-g09d2