[Build]: Fix the version not found issue (#9331)

When we update the a sai package downing from a remote server, we need to update the version file as well currently, but the reproducible build feature is not enabled in master, it can only be detected when merging the code into the release branches, such as 202106, 202012, etc.
The reproducible feature is to reduce the build failure, not need to break the build when the version not specified. If version not specified, the best choice is to accept the version from remote server.

Co-authored-by: Ubuntu <xumia@xumia-vm1.jqzc3g5pdlluxln0vevsg3s20h.xx.internal.cloudapp.net>
This commit is contained in:
xumia 2021-11-23 04:18:32 +08:00
parent 04e24c0f29
commit 0cecab27fa

View File

@ -82,8 +82,8 @@ download_packages()
local filename=$(echo $url | awk -F"/" '{print $NF}' | cut -d? -f1 | cut -d# -f1)
[ -f $WEB_VERSION_FILE ] && version=$(grep "^${url}=" $WEB_VERSION_FILE | awk -F"==" '{print $NF}')
if [ -z "$version" ]; then
echo "Failed to verify the package: $url, the version is not specified" 2>&1
exit 1
echo "Warning: Failed to verify the package: $url, the version is not specified" 1>&2
continue
fi
local version_filename="${filename}-${version}"