Merge pull request #481 from marineam/prune

prune_images: keep newer-than-latest builds
This commit is contained in:
Michael Marineau 2015-11-24 14:03:46 -08:00
commit 7cea7f4d6f

View File

@ -44,9 +44,13 @@ 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
continue if [[ "${board_path}/latest" -ef "${image_path}" || \
"${board_path}/latest/version.txt" -ot \
"${image_path}/version.txt" ]]; then
continue
fi
fi fi
# best effort attempt to clean up old mounts # best effort attempt to clean up old mounts