ci: cache: Check the sha256sum of the component

We've removed this in the part 2 of this effort, as we were not caching
the sha256sum of the component.  Now that this part has been merged,
let's get back to checking it.

Fixes: #7834 -- part 3

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-09-15 12:34:30 +02:00
parent f5e52d02d3
commit 86c41074b4

View File

@ -111,6 +111,11 @@ EOF
exit "${return_code}"
}
cleanup_and_fail() {
rm -f "${component_tarball_name}"
return 1
}
install_cached_tarball_component() {
if [ "${USE_CACHE}" != "yes" ]; then
return 1
@ -132,6 +137,7 @@ install_cached_tarball_component() {
[ "${cached_image_version}" != "${current_image_version}" ] && return 1
[ "${cached_version}" != "${current_version}" ] && return 1
sha256sum -c "${component}-sha256sum" || return $(cleanup_and_fail)
info "Using cached tarball of ${component}"
mv "${component_tarball_name}" "${component_tarball_path}"