fixed compiler config init logic

This commit is contained in:
Gregory Becker 2016-05-26 13:17:01 -07:00
parent 88bec814eb
commit 189e8b3f34

View file

@ -102,15 +102,18 @@ def init_compiler_config():
# 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 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