From 3aa24e5b13558cd80ccf0da969c9095028137857 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 19 Jan 2023 16:35:24 +0100 Subject: [PATCH] buildcache create: make "file exists" less verbose (#35019) Currently we print 3 lines of "file exist" warning per tarball, this is a bit excessive. Instead, it can be a simple single-line tty.warn message. --- lib/spack/spack/binary_distribution.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 1e9843c4738..8a333eefe38 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -554,9 +554,9 @@ class NoOverwriteException(spack.error.SpackError): """ def __init__(self, file_path): - err_msg = "\n%s\nexists\n" % file_path - err_msg += "Use -f option to overwrite." - super(NoOverwriteException, self).__init__(err_msg) + super(NoOverwriteException, self).__init__( + '"{}" exists in buildcache. Use --force flag to overwrite.'.format(file_path) + ) class NoGpgException(spack.error.SpackError):