mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 15:41:04 +02:00
Merge pull request #481 from marineam/prune
prune_images: keep newer-than-latest builds
This commit is contained in:
commit
7cea7f4d6f
@ -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…
x
Reference in New Issue
Block a user