summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-04-12 16:54:51 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-04-12 16:54:51 +0200
commit80678b2188acb30638e33b86a894d133ce4b4796 (patch)
tree195d20337cbe4dcd037d5559b3c11bac905abf08 /lib
parente73caad0d76fe8710ae054f4bcdbad1a649dbb92 (diff)
downloadspack-80678b2188acb30638e33b86a894d133ce4b4796.tar.gz
spack-80678b2188acb30638e33b86a894d133ce4b4796.tar.bz2
spack-80678b2188acb30638e33b86a894d133ce4b4796.tar.xz
spack-80678b2188acb30638e33b86a894d133ce4b4796.zip
fix : proper update of config file (before it was discarding architectures that were not the current one) fixes #774
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/compiler.py13
-rw-r--r--lib/spack/spack/config.py10
2 files changed, 12 insertions, 11 deletions
diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py
index 3e58e82184..786b3b8eb4 100644
--- a/lib/spack/spack/cmd/compiler.py
+++ b/lib/spack/spack/cmd/compiler.py
@@ -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"
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py
index 14e5aaf4fb..336d47cbb7 100644
--- a/lib/spack/spack/config.py
+++ b/lib/spack/spack/config.py
@@ -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)