say_err "Architecture \`$machine_architecture\` not supported. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues"
#any channel or version that starts with the specified versions
case"$1" in
("1"* |"2"* |"3"* |"4"* |"5"*)
echo false
return0
# Extract the major version by splitting on the dot
major_version="${1%%.*}"
# Check if the major version is a valid number and less than 6
case"$major_version" in
[0-9]*)
if["$major_version" -lt 6];then
echo false
return0
fi
;;
esac
echo true
@ -407,8 +452,13 @@ get_normalized_os() {
echo"$osname"
return0
;;
macos)
osname='osx'
echo"$osname"
return0
;;
*)
say_err "'$user_defined_os' is not a supported value for --os option, supported values are: osx, linux, linux-musl, freebsd, rhel.6. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
say_err "'$user_defined_os' is not a supported value for --os option, supported values are: osx, macos, linux, linux-musl, freebsd, rhel.6. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues."
say "The remote and local file sizes are not equal. The remote file size is $remote_file_size bytes and the local size is $file_size bytes. The local package may be corrupted."
else
say "The remote and local file sizes are equal."
fi
fi
else
say "Either downloaded or local package size can not be measured. One of them may be corrupted."
fi
}
# args:
# azure_feed - $1
# channel - $2
@ -872,6 +956,37 @@ get_absolute_path() {
return0
}
# args:
# override - $1 (boolean, true or false)
get_cp_options(){
eval$invocation
localoverride="$1"
localoverride_switch=""
if["$override"=false];then
override_switch="-n"
# create temporary files to check if 'cp -u' is supported
rm -f "$zip_path"&& say_verbose "Temporary zip file $zip_path was removed"
if[ -z ${keep_zip+x}];then
rm -f "$zip_path"&& say_verbose "Temporary archive file $zip_path was removed"
fi
if["$failed"=true];then
say_err "Extraction failed"
@ -1136,6 +1272,61 @@ downloadwget() {
return0
}
extract_stem(){
localurl="$1"
# extract the protocol
proto="$(echo$1| grep :// | sed -e's,^\(.*://\).*,\1,g')"
# remove the protocol
url="${1/$proto/}"
# extract the path (if any) - since we know all of our feeds have a first path segment, we can skip the first one. otherwise we'd use -f2- to get the full path
# 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')
# 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
echo" # Install a .NET SDK of a specific public version"
echo"$script_name [-v|--version <VERSION>]"
echo"$script_name -h|-?|--help"
echo""
echo"$script_name is a simple command line interface for obtaining dotnet cli."
@ -1655,7 +1874,7 @@ do
echo" -InstallDir"
echo" --architecture <ARCHITECTURE> Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`."
echo" --arch,-Architecture,-Arch"
echo" Possible values: x64, arm, arm64 and s390x"
echo" Possible values: x64, arm, arm64, s390x, ppc64le and loongarch64"
echo" --os <system> Specifies operating system to be used when selecting the installer."
echo" Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6."
echo" In case any other value is provided, the platform will be determined by the script based on machine configuration."
@ -1680,6 +1899,8 @@ do
echo" --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly."
echo" --jsonfile <JSONFILE> Determines the SDK version from a user specified global.json file."
echo" Note: global.json must have a value for 'SDK:Version'"
echo" --keep-zip,-KeepZip If set, downloaded file is kept."
echo" --zip-path, -ZipPath If set, downloaded file is stored at the specified path."
echo" -?,--?,-h,--help,-Help Shows this help message"
echo""
echo"Install Location:"
@ -1735,4 +1956,4 @@ fi
say "Note that the script does not resolve dependencies during installation."
say "To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section."