Skip to content

Commit 9a13867

Browse files
committed
prune_images: keep newer-than-latest builds
This may include recent failures or builds derrived from latest, such as those made by image_set_group.
1 parent f0be34f commit 9a13867

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

prune_images

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ for board_path in "${board_paths[@]}"; do
4444
continue
4545
fi
4646

47-
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} &&
48-
"${board_path}/latest" -ef "${image_path}" ]]; then
49-
continue
47+
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} ]]; then
48+
# keep anything that is or newer than the latest
49+
if [[ "${board_path}/latest" -ef "${image_path}" || \
50+
"${board_path}/latest/version.txt" -ot \
51+
"${image_path}/version.txt" ]]; then
52+
continue
53+
fi
5054
fi
5155

5256
# best effort attempt to clean up old mounts

0 commit comments

Comments
 (0)