Skip to content
Snippets Groups Projects
Commit 80678b21 authored by Massimiliano Culpo's avatar Massimiliano Culpo
Browse files

fix : proper update of config file (before it was discarding architectures...

fix :  proper update of config file (before it was discarding architectures that were not the current one) fixes #774
parent e73caad0
Branches
Tags
No related merge requests found
......@@ -152,7 +152,7 @@ def main():
command = spack.cmd.get_command(args.command)
try:
return_val = command(parser, args)
except SpackError, e:
except SpackError as e:
e.die()
except KeyboardInterrupt:
sys.stderr.write('\n')
......
......@@ -22,19 +22,18 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import sys
import argparse
import sys
import llnl.util.tty as tty
from llnl.util.tty.color import colorize
from llnl.util.tty.colify import colify
from llnl.util.lang import index_by
import spack.compilers
import spack.spec
import spack.config
from spack.util.environment import get_path
import spack.spec
from llnl.util.lang import index_by
from llnl.util.tty.colify import colify
from llnl.util.tty.color import colorize
from spack.spec import CompilerSpec
from spack.util.environment import get_path
description = "Manage compilers"
......
......@@ -539,14 +539,16 @@ def update_config(section, update_data, scope=None):
other yaml-ish structure.
"""
validate_section_name(section) # validate section name
scope = validate_scope(scope) # get ConfigScope object from string.
# read in the config to ensure we've got current data
get_config(section)
configuration = get_config(section)
validate_section_name(section) # validate section name
scope = validate_scope(scope) # get ConfigScope object from string.
configuration.update(update_data)
# read only the requested section's data.
scope.sections[section] = { section : update_data }
scope.sections[section] = {section: configuration}
scope.write_section(section)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment