diff options
author | Wouter Deconinck <wdconinc@gmail.com> | 2022-08-16 16:06:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 21:06:31 +0000 |
commit | 8f34a3ac5c7ff09751007d57c88884aee48921bb (patch) | |
tree | 1e37ad4f20239b634bc75fe6d0895664b51d17d3 /lib/spack | |
parent | 7e1890772cfbe1ecbf26c2a874ab95ac2d4eeef6 (diff) | |
download | spack-8f34a3ac5c7ff09751007d57c88884aee48921bb.tar.gz spack-8f34a3ac5c7ff09751007d57c88884aee48921bb.tar.bz2 spack-8f34a3ac5c7ff09751007d57c88884aee48921bb.tar.xz spack-8f34a3ac5c7ff09751007d57c88884aee48921bb.zip |
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.
Diffstat (limited to 'lib/spack')
-rw-r--r-- | lib/spack/llnl/util/filesystem.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 ) |