Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] fix md5sum calculation of web packages if transient error #13013

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ check_version_control()
get_url_version()
{
local package_url=$1
/usr/bin/curl -Lks $package_url | md5sum | cut -d' ' -f1
set -o pipefail
/usr/bin/curl -Lfks --retry 5 $package_url | md5sum | cut -d' ' -f1
}

check_if_url_exist()
Expand Down Expand Up @@ -127,14 +128,14 @@ download_packages()
filenames[$version_filename]=$filename
real_version=$version
else
real_version=$(get_url_version $url)
real_version=$(get_url_version $url) || { echo "get_url_version $url failed"; exit 1; }
if [ "$real_version" != "$version" ]; then
echo "Failed to verify url: $url, real hash value: $real_version, expected value: $version_filename" 1>&2
exit 1
fi
fi
else
real_version=$(get_url_version $url)
real_version=$(get_url_version $url) || { echo "get_url_version $url failed"; exit 1; }
fi

echo "$url==$real_version" >> ${BUILD_WEB_VERSION_FILE}
Expand Down