summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-06-24 07:17:30 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-06-24 07:17:30 -0700
commit9f8ef85644883a53578fb000827cb937a16d058e (patch)
tree3828001e72f523b878ffda2d617026a53f8e09f9
parent8165393962c204650174c43606396f71c506df51 (diff)
downloadspack-9f8ef85644883a53578fb000827cb937a16d058e.tar.gz
spack-9f8ef85644883a53578fb000827cb937a16d058e.tar.bz2
spack-9f8ef85644883a53578fb000827cb937a16d058e.tar.xz
spack-9f8ef85644883a53578fb000827cb937a16d058e.zip
Add more output; don't re-add existing compilers
-rw-r--r--lib/spack/spack/cmd/compiler.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/compiler.py b/lib/spack/spack/cmd/compiler.py
index 0586484c32..a4cd2df7e2 100644
--- a/lib/spack/spack/cmd/compiler.py
+++ b/lib/spack/spack/cmd/compiler.py
@@ -60,8 +60,17 @@ def compiler_add(args):
if not paths:
paths = get_path('PATH')
- compilers = spack.compilers.find_compilers(*args.add_paths)
- spack.compilers.add_compilers_to_config('user', *compilers)
+ compilers = [c for c in spack.compilers.find_compilers(*args.add_paths)
+ if c.spec not in spack.compilers.all_compilers()]
+
+ if compilers:
+ spack.compilers.add_compilers_to_config('user', *compilers)
+ n = len(compilers)
+ tty.msg("Added %d new compiler%s to %s" % (
+ n, 's' if n > 1 else '', spack.config.get_filename('user')))
+ colify(reversed(sorted(c.spec for c in compilers)), indent=4)
+ else:
+ tty.msg("Found no new compilers")
def compiler_remove(args):