From 8f34a3ac5c7ff09751007d57c88884aee48921bb Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 16 Aug 2022 16:06:31 -0500 Subject: filesystem: in recursive mtime, check only files that exist (#32175) * filesystem: use lstat in recursive mtime When a `develop` path contains a dead symlink, the `os.stat` in the recursive `mtime` determination trips up over it. Closes #32165. --- lib/spack/llnl/util/filesystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index a690ef3c37..8a420756ef 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -1293,7 +1293,7 @@ def last_modification_time_recursive(path): path = os.path.abspath(path) times = [os.stat(path).st_mtime] times.extend( - os.stat(os.path.join(root, name)).st_mtime + os.lstat(os.path.join(root, name)).st_mtime for root, dirs, files in os.walk(path) for name in dirs + files ) -- cgit v1.2.3-60-g2f50