summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/filesystem.py
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2017-08-02 12:51:12 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2018-02-13 02:18:28 -0800
commit4e48bae0962c6494f421198afb756498e9580b66 (patch)
tree5b8410d20d2c90ff6060aed72cd20bcfbbab1d2f /lib/spack/llnl/util/filesystem.py
parenta01a68218c0e476bcc6801532bff694fd40bc968 (diff)
downloadspack-4e48bae0962c6494f421198afb756498e9580b66.tar.gz
spack-4e48bae0962c6494f421198afb756498e9580b66.tar.bz2
spack-4e48bae0962c6494f421198afb756498e9580b66.tar.xz
spack-4e48bae0962c6494f421198afb756498e9580b66.zip
mixins: moved debug logs to 'filter_file'. Renamed shadowed variable name.
Following comments from Todd: - the call to tty.debug has been moved deeper, to log the filtering of each file - the shadowing on the name "kwargs" is avoided
Diffstat (limited to 'lib/spack/llnl/util/filesystem.py')
-rw-r--r--lib/spack/llnl/util/filesystem.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py
index 36be87580c..f8d77e2727 100644
--- a/lib/spack/llnl/util/filesystem.py
+++ b/lib/spack/llnl/util/filesystem.py
@@ -119,9 +119,15 @@ def filter_file(regex, repl, *filenames, **kwargs):
regex = re.escape(regex)
for filename in filenames:
+
+ msg = 'FILTER FILE: {0} [replacing "{1}"]'
+ tty.debug(msg.format(filename, regex))
+
backup_filename = filename + "~"
if ignore_absent and not os.path.exists(filename):
+ msg = 'FILTER FILE: file "{0}" not found. Skipping to next file.'
+ tty.debug(msg.format(filename))
continue
# Create backup file. Don't overwrite an existing backup