summaryrefslogtreecommitdiff
path: root/buildscripts/scons_cache_prune.py
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-06-15 16:47:13 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-21 15:13:02 +0000
commitbd1ea07226c0dd3b68725da0daf1a20b896a04b2 (patch)
tree36beed90ce3da75e0b47a3faccbb8668fa7372e4 /buildscripts/scons_cache_prune.py
parentb9c0476007805e8b26e696cd4ff8dbe3257b0cb4 (diff)
downloadmongo-bd1ea07226c0dd3b68725da0daf1a20b896a04b2.tar.gz
SERVER-57732 update scons cache prune script to handle other alternate cksum files
Diffstat (limited to 'buildscripts/scons_cache_prune.py')
-rw-r--r--buildscripts/scons_cache_prune.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/buildscripts/scons_cache_prune.py b/buildscripts/scons_cache_prune.py
index ce327f35da0..9b32db16b1f 100644
--- a/buildscripts/scons_cache_prune.py
+++ b/buildscripts/scons_cache_prune.py
@@ -27,7 +27,7 @@ CacheItem = collections.namedtuple("CacheContents", ["path", "time", "size"])
def get_cachefile_size(file_path):
"""Get the size of the cachefile."""
- if file_path.endswith('.cksum'):
+ if file_path.lower().endswith('.cksum') or file_path.lower().endswith('.cksum.del'):
size = 0
for cksum_path in os.listdir(file_path):
cksum_path = os.path.join(file_path, cksum_path)
@@ -53,7 +53,8 @@ def collect_cache_contents(cache_path):
# Cache prune script is allowing only directories with this extension
# which comes from the validate_cache_dir.py tool in scons, it must match
# the extension set in that file.
- if os.path.isdir(file_path) and not file_path.endswith('.cksum'):
+ if os.path.isdir(file_path) and not file_path.lower().endswith(
+ '.cksum') and not file_path.lower().endswith('.cksum.del'):
LOGGER.warning(
"cache item %s is a directory and not a file. "
"The cache may be corrupt.", file_path)