Update the installation scripts in release/2.0.0 branch.

This commit is contained in:
John Beisner 2017-09-22 11:25:15 -07:00
parent 5d4d7bf619
commit 0722cce590
2 changed files with 85 additions and 45 deletions

View file

@ -55,6 +55,9 @@ say_verbose() {
fi
}
# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets,
# then and only then should the Linux distribution appear in this list.
# Adding a Linux distribution to this list does not imply distribution-specific support.
get_os_download_name_from_platform() {
eval $invocation
@ -84,6 +87,10 @@ get_os_download_name_from_platform() {
echo "opensuse.42.1"
return 0
;;
"rhel.6"*)
echo "rhel.6"
return 0
;;
"rhel.7"*)
echo "rhel"
return 0
@ -115,8 +122,14 @@ get_current_os_name() {
if [ "$uname" = "Darwin" ]; then
echo "osx"
return 0
else
if [ "$uname" = "Linux" ]; then
elif [ "$uname" = "Linux" ]; then
local distro_specific_osname
distro_specific_osname=$(get_distro_specific_os_name) || return 1
if [ "$distro_specific_osname" = "rhel.6" ]; then
echo $distro_specific_osname
return 0
else
echo "linux"
return 0
fi
@ -144,6 +157,12 @@ get_distro_specific_os_name() {
echo "$os"
return 0
fi
elif [ -e /etc/redhat-release ]; then
local redhatRelease=$(</etc/redhat-release)
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
echo "rhel.6"
return 0
fi
fi
fi
@ -191,9 +210,13 @@ check_pre_reqs() {
LDCONFIG_COMMAND="ldconfig"
fi
[ -z "$($LDCONFIG_COMMAND -p | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true
[ -z "$($LDCONFIG_COMMAND -p | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true
[ -z "$($LDCONFIG_COMMAND -p | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true
local librarypath=${LD_LIBRARY_PATH:-}
LDCONFIG_COMMAND="$LDCONFIG_COMMAND -NXv ${LD_LIBRARY_PATH//:/ }"
[ -z "$($LDCONFIG_COMMAND | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true
[ -z "$($LDCONFIG_COMMAND | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true
[ -z "$($LDCONFIG_COMMAND | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true
[ -z "$($LDCONFIG_COMMAND | grep -F libcurl.so)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true
fi
if [ "$failing" = true ]; then
@ -333,6 +356,7 @@ is_dotnet_package_installed() {
# azure_feed - $1
# channel - $2
# normalized_architecture - $3
# coherent - $4
get_latest_version_info() {
eval $invocation
@ -541,7 +565,7 @@ extract_dotnet_package() {
local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/'
find $temp_out_path -type f | grep -Eo $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path false
find $temp_out_path -type f | grep -Ev $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path true
find $temp_out_path -type f | grep -Ev $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path $override_non_versioned_files
rm -rf $temp_out_path
@ -600,7 +624,7 @@ downloadwget() {
local failed=false
if [ -z "$out_path" ]; then
wget -q --tries 10 $remote_path || failed=true
wget -q --tries 10 -O - $remote_path || failed=true
else
wget -v --tries 10 -O $out_path $remote_path || failed=true
fi
@ -654,7 +678,9 @@ install_dotnet() {
say_verbose "Zip path: $zip_path"
say "Downloading link: $download_link"
download "$download_link" $zip_path || download_failed=true
# Failures are normal in the non-legacy case for ultimately legacy downloads.
# Do not output to stderr, since output to stderr is considered an error.
download "$download_link" $zip_path 2>&1 || download_failed=true
# if the download fails, download the legacy_download_link
if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then
@ -687,6 +713,7 @@ uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet"
verbose=false
shared_runtime=false
runtime_id=""
override_non_versioned_files=true
while [ $# -ne 0 ]
do
@ -732,6 +759,10 @@ do
shift
runtime_id="$1"
;;
--skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles)
shift
override_non_versioned_files=false
;;
-?|--?|-h|--help|-[Hh]elp)
script_name="$(basename $0)"
echo ".NET Tools Installer"
@ -764,6 +795,8 @@ do
echo " --arch,-Architecture,-Arch"
echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK."
echo " -SharedRuntime"
echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable."
echo " -SkipNonVersionedFiles"
echo " --dry-run,-DryRun Do not perform installation. Display download link."
echo " --no-path, -NoPath Do not set PATH for the current process."
echo " --verbose,-Verbose Display diagnostics information."