From 7228a96d49c8090ec5547ffdf0d6fd2324d7a3f2 Mon Sep 17 00:00:00 2001 From: jbeisner Date: Fri, 16 Mar 2018 19:56:02 +0000 Subject: [PATCH 1/3] The '-n' option to 'cp' does not exist for Alpine; don't use "$ID.$VERSION_ID" for the error message. --- scripts/obtain/dotnet-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 04b5a38203..1a32fa2c77 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -139,7 +139,7 @@ get_linux_platform_name() { fi fi - say_verbose "Linux specific platform name and version could not be detected: $ID.$VERSION_ID" + say_verbose "Linux specific platform name and version could not be detected: UName = $uname" return 1 } @@ -163,7 +163,7 @@ get_current_os_name() { fi fi - say_err "OS name could not be detected: $ID.$VERSION_ID" + say_err "OS name could not be detected: UName = $uname" return 1 } @@ -188,7 +188,7 @@ get_legacy_os_name() { fi fi - say_verbose "Distribution specific OS name and version could not be detected: $ID.$VERSION_ID" + say_verbose "Distribution specific OS name and version could not be detected: UName = $uname" return 1 } @@ -570,7 +570,7 @@ copy_files_or_dirs_from_list() { local root_path="$(remove_trailing_slash "$1")" local out_path="$(remove_trailing_slash "$2")" local override="$3" - local override_switch=$(if [ "$override" = false ]; then printf -- "-n"; fi) + local override_switch=$(if [ "$override" = false ] && [[ $linux_platform_name != 'alpine'* ]]; then printf -- "-n"; fi) cat | uniq | while read -r file_path; do local path="$(remove_beginning_slash "${file_path#$root_path}")" @@ -878,7 +878,7 @@ do echo " Possible values:" echo " - dotnet - the Microsoft.NETCore.App shared runtime" echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" - echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." + echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable. (not supported for Alpine)" 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." From ef2621aff858de2759235171fee37dabaeaa9090 Mon Sep 17 00:00:00 2001 From: jbeisner Date: Fri, 16 Mar 2018 22:01:16 +0000 Subject: [PATCH 2/3] Try "cp -R -u" for alpine variants. --- scripts/obtain/dotnet-install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 1a32fa2c77..216341a97d 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -145,13 +145,13 @@ get_linux_platform_name() { get_current_os_name() { eval $invocation + linux_platform_name="unknown" local uname=$(uname) if [ "$uname" = "Darwin" ]; then echo "osx" return 0 elif [ "$uname" = "Linux" ]; then - local linux_platform_name linux_platform_name="$(get_linux_platform_name)" || { echo "linux" && return 0 ; } if [[ $linux_platform_name == "rhel.6" || $linux_platform_name == "alpine.3.6" ]]; then @@ -570,7 +570,14 @@ copy_files_or_dirs_from_list() { local root_path="$(remove_trailing_slash "$1")" local out_path="$(remove_trailing_slash "$2")" local override="$3" - local override_switch=$(if [ "$override" = false ] && [[ $linux_platform_name != 'alpine'* ]]; then printf -- "-n"; fi) + local override_switch=$( + if [ "$override" = false ]; then + if [[ $linux_platform_name == 'alpine'* ]]; then + printf -- "-u"; + else + printf -- "-n"; + fi + fi) cat | uniq | while read -r file_path; do local path="$(remove_beginning_slash "${file_path#$root_path}")" From f97d234fcc2444ebb9230f094b0d66f5140a0307 Mon Sep 17 00:00:00 2001 From: jbeisner Date: Fri, 16 Mar 2018 22:02:49 +0000 Subject: [PATCH 3/3] Fixing a comment... --- scripts/obtain/dotnet-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 216341a97d..00a42d872c 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -885,7 +885,7 @@ do echo " Possible values:" echo " - dotnet - the Microsoft.NETCore.App shared runtime" echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" - echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable. (not supported for Alpine)" + 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."