mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
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.
This commit is contained in:
parent
f0be34f4dd
commit
9a138677a8
@ -44,10 +44,14 @@ for board_path in "${board_paths[@]}"; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} &&
|
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} ]]; then
|
||||||
"${board_path}/latest" -ef "${image_path}" ]]; then
|
# keep anything that is or newer than the latest
|
||||||
|
if [[ "${board_path}/latest" -ef "${image_path}" || \
|
||||||
|
"${board_path}/latest/version.txt" -ot \
|
||||||
|
"${image_path}/version.txt" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# best effort attempt to clean up old mounts
|
# best effort attempt to clean up old mounts
|
||||||
safe_umount_tree "${image_path}"
|
safe_umount_tree "${image_path}"
|
||||||
|
Loading…
Reference in New Issue
Block a user