summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 896cbe879b..7bef1d3789 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -739,8 +739,13 @@ class ChildError(spack.error.SpackError):
# the build log with errors highlighted.
if self.build_log:
events = parse_log_events(self.build_log)
- out.write("\n%d errors in build log:\n" % len(events))
- out.write(make_log_context(events))
+ nerr = len(events)
+ if nerr > 0:
+ if nerr == 1:
+ out.write("\n1 error found in build log:\n")
+ else:
+ out.write("\n%d errors found in build log:\n" % nerr)
+ out.write(make_log_context(events))
else:
# The error happened in in the Python code, so try to show