check failure fix

This commit is contained in:
gowridurgad
2025-12-22 17:28:52 +05:30
parent 4c266a46d5
commit 549aadfec5
7 changed files with 414 additions and 1039 deletions

View File

@@ -661,7 +661,7 @@ parse_globaljson_file_for_version() {
return 1
fi
sdk_section=$(cat $json_file | tr -d "\r" | awk '/"sdk"/,/}/')
sdk_section=$(cat "$json_file" | tr -d "\r" | awk '/"sdk"/,/}/')
if [ -z "$sdk_section" ]; then
say_err "Unable to parse the SDK node in \`$json_file\`"
return 1
@@ -783,7 +783,7 @@ get_specific_product_version() {
if machine_has "curl"
then
if ! specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1); then
if ! specific_product_version=$(curl -sL --fail "${download_link}${feed_credential}" 2>&1); then
continue
else
echo "${specific_product_version//[$'\t\r\n']}"
@@ -1312,13 +1312,13 @@ get_download_link_from_aka_ms() {
say_verbose "Received response: $response"
# Get results of all the redirects.
http_codes=$( echo "$response" | awk '$1 ~ /^HTTP/ {print $2}' )
# They all need to be 301, otherwise some links are broken (except for the last, which is not a redirect but 200 or 404).
broken_redirects=$( echo "$http_codes" | sed '$d' | grep -v '301' )
# Allow intermediate 301 redirects and tolerate proxy-injected 200s
broken_redirects=$( echo "$http_codes" | sed '$d' | grep -vE '^(301|200)$' )
# The response may end without final code 2xx/4xx/5xx somehow, e.g. network restrictions on www.bing.com causes redirecting to bing.com fails with connection refused.
# In this case it should not exclude the last.
last_http_code=$( echo "$http_codes" | tail -n 1 )
if ! [[ $last_http_code =~ ^(2|4|5)[0-9][0-9]$ ]]; then
broken_redirects=$( echo "$http_codes" | grep -v '301' )
broken_redirects=$( echo "$http_codes" | grep -vE '^(301|200)$' )
fi
# All HTTP codes are 301 (Moved Permanently), the redirect link exists.
@@ -1796,7 +1796,6 @@ do
echo " -Quality"
echo " The possible values are: daily, preview, GA."
echo " Works only in combination with channel. Not applicable for STS and LTS channels and will be ignored if those channels are used."
echo " For SDK use channel in A.B.Cxx format. Using quality for SDK together with channel in A.B format is not supported."
echo " Supported since 5.0 release."
echo " Note: The version parameter overrides the channel parameter when any version other than 'latest' is used, and therefore overrides the quality."
echo " --internal,-Internal Download internal builds. Requires providing credentials via --feed-credential parameter."